코딩하는 개굴이

BaekJoon/BOJ [JAVA] 합_8393 본문

알고리즘/Baekjoon

BaekJoon/BOJ [JAVA] 합_8393

개굴이모자 2018. 11. 16. 16:43
반응형

BaekJoon/BOJ [JAVA] 합_8393

HINT: 다 더하자


import java.util.Scanner;
public class baekjoon_8393 {
    public static void main(String[] argc){
        Scanner scanner = new Scanner(System.in);
        int num = Integer.parseInt(scanner.next());
        int total=0;
        for(int i=1;i<=num;i++){
            total+=i;
        }
        System.out.println(total);
    }
}


반응형
Comments