Browse Source

Neue Version mit Eingabeparameter

master
david 1 year ago
parent
commit
21c443a99d
1 changed files with 7 additions and 3 deletions
  1. 7
    3
      src/Praktikum01/Zahlenfilter.java

+ 7
- 3
src/Praktikum01/Zahlenfilter.java View File

public class Zahlenfilter { public class Zahlenfilter {


public static void main(String[] args){ public static void main(String[] args){
zahlenfilter();
int loop = 200;
if (args != null || args.length != 0){
loop = Integer.parseInt(args[0]);
}
zahlenfilter(loop);
} }


private static void zahlenfilter() {
for (int i = 0; i < 200; i++){
private static void zahlenfilter(int loop) {
for (int i = 0; i < loop; i++){
if(i != 0){ if(i != 0){
int j = i -1; int j = i -1;
if(i%5 == 0){ if(i%5 == 0){

Loading…
Cancel
Save