728x90

풀이)

import java.util.Scanner;
import java.io.FileInputStream;
 

class Solution
{
    public static void main(String args[]) throws Exception
    {
       
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
 
        for(int i=1; i<=n; i++){
            ans += i;
 
        }
        System.out.println(ans);
    }
}
728x90