|
|
|
|
|
|
|
|
package Praktikum01; |
|
|
package Praktikum01; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class Zahlenfilter { |
|
|
public class Zahlenfilter { |
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
|
int upper_limit = 200; |
|
|
|
|
|
if (args.length > 0){ |
|
|
|
|
|
upper_limit = Integer.parseInt(args[0]); |
|
|
|
|
|
}else{ |
|
|
|
|
|
System.out.println("Keine Zahl eingegeben. Es wird mit 200 weitergearbeitet."); |
|
|
|
|
|
} |
|
|
|
|
|
int count = 1; |
|
|
|
|
|
Zahlenfilter z = new Zahlenfilter(upper_limit); |
|
|
|
|
|
z.run(count); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int limit; |
|
|
|
|
|
|
|
|
|
|
|
private Zahlenfilter(int limit){ |
|
|
|
|
|
|
|
|
public static void counter(int c, int endC){ |
|
|
|
|
|
|
|
|
this.limit = limit; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
for(int i = 0; i < endC; i++){ |
|
|
|
|
|
|
|
|
private void run(int c){ |
|
|
|
|
|
for(int i = 0; i < this.limit; i++){ |
|
|
int preC = c-1; |
|
|
int preC = c-1; |
|
|
int ergebnis = c + preC; |
|
|
int ergebnis = c + preC; |
|
|
int ergebnis2 = preC + c; |
|
|
int ergebnis2 = preC + c; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |