IMS-java/Code/Steiner/whileToFor/src/App.java

18 lines
359 B
Java
Raw Normal View History

2024-06-24 08:18:59 +02:00
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);
}
}