geändert am 24.10.2023

This commit is contained in:
leonmcfly
2023-10-24 15:51:40 +02:00
commit 6ca8526699
8 changed files with 78 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
package Praktikum01;
public class Zahlenfilter {
public static void main(String[] args) {
int count = 1;
counter(count);
}
public static void counter(int c){
for(int i = 0; i < 200; i++){
int preC = c-1;
int ergebnis = c + preC;
int ergebnis2 = preC + c;
if (c % 5 == 0){
System.out.println(c + " ist durch 5 teilbar");
c++;
}else if(c % 10 == 9){
System.out.println(c + " endet auf 9");
c++;
}else if(ergebnis % 3 == 0 && ergebnis2 % 3 == 0){
System.out.println(c + " und " + preC + " addiert ergeben " + ergebnis + " und " + ergebnis2 + " ist durch 3 teilbar." );
c++;
}else{
System.out.println(c);
c++;
}
}
}
}