본문 바로가기

알고리즘/Java

(JAVA) 백준 알고리즘 4단계 10952번 : A + B - 5

while문

 

소스

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import java.util.Scanner;
public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
       
        while(true){
            int a = scan.nextInt();
            int b = scan.nextInt();
                if(a==0 && b==0)
                    break;
                    System.out.println(a+b);
        }
    }
}
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter