휴지통665 백준 10952 import java.util.Scanner; public class Main10952 { 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 ){ break; } System.out.println(A+B); } } } 2021. 7. 3. 백준 10951 import java.util.Scanner; public class Main10951 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNextInt()){ int A = sc.nextInt(); int B = sc.nextInt(); System.out.println(A+B); } } } 이 문제는 따로 10952문제처럼 특정 조건이 없고, 입력의 종료를 나타내면 반복문을 종료해야 한다. 위의 정답에서는 Scanner을 사용해 입력받았다. sc.nextInt()는 정수를 입력 받는것이고, sc.hasNextInt()는 숫자가 입력될때는 true를 반환 , 숫자가 입력이 안되면 false를.. 2021. 7. 3. 재귀 호출(Recursive Call) 보호되어 있는 글 입니다. 2021. 7. 3. 삽입 정렬 (Insertion Sort) 보호되어 있는 글 입니다. 2021. 7. 3. 선택 정렬 보호되어 있는 글 입니다. 2021. 7. 2. 버블 정렬 보호되어 있는 글 입니다. 2021. 7. 2. 이전 1 ··· 94 95 96 97 98 99 100 ··· 111 다음