Skip to content

Instantly share code, notes, and snippets.

@peter279k peter279k/JPA03.java
Created May 24, 2017

Embed
What would you like to do?
TQC+JAVA
import java.util.*;
class JPA03 {
public static void main(String argv[]) {
Scanner input = new Scanner(System.in);
System.out.println("Input:");
int N = input.nextInt();
int sum = 0;
for (int index=1;index<=N;index++) {
sum += index;
}
System.out.println("1 + ... + " + N + " = " + sum);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.