kleiner fortschritt

main
student 2026-04-01 13:34:55 +02:00
parent e7b26cb1cd
commit 5436390b22
2 changed files with 44 additions and 6 deletions

View File

@ -1,9 +1,10 @@
public class Aufgabe1 { public class Aufgabe1 {
private LinkedList list; private LinkedList list;
private Knoten knot;
public static void main(String[] args) { public static void main(String[] args) {
LinkedList list = new LinkedList(3); LinkedList list = new LinkedList(3);
list.einfügen(3); list.einfügen(5);
} }
@ -28,12 +29,12 @@ class LinkedList {
} }
public static int auslesen(int index) { public static int auslesen(int index) {
int zahl; int zahl = list[index];
return zahl; return zahl;
} }
public static void löschen(int index) { public static void löschen(int index) {
list.remove(index);
} }
System.out.println(IndexOutOfBoundsException); System.out.println(IndexOutOfBoundsException);

View File

@ -14,19 +14,56 @@ public class Aufgabe2 {
} }
for (int i = arr.length-1; i > 0;i--) { for (int i = arr.length-1; i > 0;i--) {
int ziff = ziffer(i);
switch(ziff) {
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
default:
break;
}
} }
return arr; return arr;
} }
public static int ziffer(int zahl) { public static int ziffer(int zahl) {
int relevant = 0;
for (int i = 2; i < 9;i++) { for (int i = 2; i < 9;i++) {
if(zahl%i == 0) if(zahl%i == 0)
return relevant=i; return i;
} }
if((zahl-1)%10 == 0)
return 1;
return 0;
} }
} }