Ich sitze jetzt schon eine Weile und komm einfach nicht weiter ich weis nicht was ich falsch gemacht habe oder vlt denke ich auch ganz falsch.(https://projecteuler.net/problem=1)
Code:
public class Projekt1 {
public static void main(String[] args) {
int i, x, y, j;
i = 0;// Zum laufen der schleife benötigt
x = 0;// Fertige Summe
j = 1;// Um 3 zu multiplizieren
y = 0;// zum addieren der Summe
while (i < 1000){
y = j * 3;
j++;
i++;
x = x + y;
y = 0;
}
}
}
Zuletzt bearbeitet von einem Moderator: