728x90 반응형 2025. N줄덧셈.D11 2025. N줄덧셈.D1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int sum=0; for(int i=n;i>0;i--) { sum+=i; } System.out.println(sum); } } Colored by Color Scripter cs 2022. 2. 5. 이전 1 다음 728x90 반응형