IMS-java/Code/Steiner/whileToFor/src/App.java
2024-08-27 10:41:17 +02:00

17 lines
359 B
Java

import java.util.Scanner;
public class App {
static Scanner scan = new Scanner(System.in);
public static void main(String[] args) throws Exception {
int summe = 0;
for (int x = 1; x < 3; x++) {
for (int y = x; y > 1; y--) {
summe += y;
}
}
System.out.println(summe);
}
}