Skip to content

Instantly share code, notes, and snippets.

@spangenberg
Created November 6, 2011 19:54
Show Gist options
  • Save spangenberg/1343384 to your computer and use it in GitHub Desktop.
Save spangenberg/1343384 to your computer and use it in GitHub Desktop.
import java.util.*;
class Aufgabe1 {
public static void main(String[] args) {
int out = 0;
System.out.println("Dieses Programm berechnet die Partialsummenfolge einer Zahl\n");
System.out.print("Zahl = ");
Scanner input = new Scanner(System.in);
int end = input.nextInt();
System.out.println();
for (int i = 1; i <= end; i++) {
out = out + (i * 10 + 2);
}
System.out.println(out);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment