Skip to content

Commit

Permalink
BEGIN-2
Browse files Browse the repository at this point in the history
  • Loading branch information
JoyHwong committed Jan 18, 2016
1 parent 59a7696 commit 3071c4b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions BEGIN/begin2/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package begin2;

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

Scanner in = new Scanner(System.in);
long n = in.nextLong();
in.close();

// Gauss sum.
System.out.println((1 + n) * n / 2);
}

}

0 comments on commit 3071c4b

Please sign in to comment.