Created
May 24, 2017 05:36
-
-
Save peter279k/b67128dc0214be3aa0d5b0eda3d3f9ab to your computer and use it in GitHub Desktop.
TQC+JAVA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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