본문 바로가기
휴지통/알고리즘 & 자료구조

백준 8393

by 신재권 2021. 6. 29.
import java.util.Scanner;


public class Main8393 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int sum=0;
		for(int i=1; i <= n; i++)
			sum+=i;
		
		System.out.println(sum);

	}

}

'휴지통 > 알고리즘 & 자료구조' 카테고리의 다른 글

힙(Heap)  (0) 2021.07.01
백준 9498  (0) 2021.06.29
백준 2884  (0) 2021.06.29
백준 2753  (0) 2021.06.29
백준 2739  (0) 2021.06.29