알고리즘 (43) 썸네일형 리스트형 [JAVA] 백준 알고리즘 8393 : 합 1부터 N까지 합을 구합니다 문제 n이 주어졌을 때, 1부터 n까지 합을 구하는 프로그램을 작성하시오. 소스 import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int input = sc.nextInt(); int result = 0; while (input > 0) { result += input; input--; } System.out.print(result); } } 출처 https://www.acmicpc.net/problem/8393 [JAVA] 백준 알고리즘 2441 : 별찍기 - 4 첫째 줄에는 별 N개, 둘째 줄에는 별 N-1개, ..., N번째 줄에는 별 1개를 출력해 봅니다. (오른쪽 정렬) 문제 ***** **** *** ** * 소스 import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int input = sc.nextInt(); for(int i=1; i [JAVA] 백준 알고리즘 7287 : 등록 자신이 acmicpc.net에서 푼 문제의 수와 acmicpc.net 아이디를 출력하는 문제 문제 소스 public class Main { public static void main(String[] args) throws Exception { System.out.println(7); System.out.println("s8197"); } } 출처 https://www.acmicpc.net/problem/7287 이전 1 ··· 6 7 8 9 다음