목록Algorithm (156)
gimmickbutreal

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import java.util.Scanner; public class Main { public static void main(String args[]){ Scanner sc=new Scanner(System.in); while(true){ int A=sc.nextInt(); int B=sc.nextInt(); if(A==0 && B==0){ sc.close(); break; } System.out.println(A+B); } } } Colored by Color Scripter cs

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 // 정수 N개로 이루어진 수열 A와 정수 X가 주어진다. 이때, A에서 X보다 작은 수를 모두 출력하는 프로그램을 작성하시오. // 첫째 줄에 N과 X가 주어진다. (1 ≤ N, X ≤ 10,000) // 둘째 줄에 수열 A를 이루는 정수 N개가 주어진다. 주어지는 정수는 모두 1보다 크거나 같고, 10,000보다 작거나 같은 정수이다. // X보다 작은 수를 입력받은 순서대로 공백으로 구분해 출력한다. X보다 작은 수는 적어도 하나 존재한다. import java.util.Scanner; public class Main{ public static void main(String args[])..

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 import java.util.Scanner; public class Main{ public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.close(); for(int i1=1;i1=1;i2--) { System.out.printf(" "); } for(int i3=1;i3

https://www.acmicpc.net/problem/2438 2438번: 별 찍기 - 1 첫째 줄에는 별 1개, 둘째 줄에는 별 2개, N번째 줄에는 별 N개를 찍는 문제 www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 import java.util.Scanner; public class Main{ public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.close(); for(int i1 = 1; i1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import java.util.Scanner; public class Main{ public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a,b,c; for(int i=1; i
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 // 각 테스트 케이스마다 "Case #x: "를 출력한 다음, A+B를 출력한다. 테스트 케이스 번호는 1부터 시작한다. import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner in = new Scanner(System.in); int a = in.nextInt(); for (int i = 1; i
1 2 3 4 5 6 7 8 9 10 11 12 13 // 첫째 줄부터 N번째 줄 까지 차례대로 출력한다. import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); in.close(); for (int i = n; i > 0; --i) { System.out.println(i); } } } Colored by Color Scripter cs tip) - --i 개념 파악하기
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // 각 테스트케이스마다 A+B를 한 줄에 하나씩 순서대로 출력한다. import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = in.nextInt(); in.close(); for (int i = 1; i