Hallo
This commit is contained in:
parent
d3130ca6d8
commit
4863c9d8f0
@ -1,10 +1,23 @@
|
||||
package Praktikum1;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Zahlenfilter {
|
||||
public static void main(String[] args) {
|
||||
int grenzwert = 200; // Der Default-Wert
|
||||
|
||||
if (args.length > 0) {
|
||||
try {
|
||||
grenzwert = Integer.parseInt(args[0]);
|
||||
} catch (NumberFormatException e) {
|
||||
System.out.println("Fehler: Ungültige Eingabe. Verwende den Default-Wert 200.");
|
||||
grenzwert = 200; // Setze den Default-Wert, wenn die Eingabe ungültig ist.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(int i=0;i<200;i++){
|
||||
|
||||
for(int i=0;i<grenzwert;i++){
|
||||
System.out.println(i);
|
||||
if(istdurch5teilbar(i)){
|
||||
System.out.println(" ist duch 5 teilbar");
|
||||
|
Loading…
x
Reference in New Issue
Block a user