[ACM] Problem HDU 1000 + Java

//no package name 
//import when necessary
import java.util.Scanner;

//it has to be Main class
public class Main {
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		
		//Wrong answer when using while(true)
		while(input.hasNext()){
			int a = input.nextInt(), b = input.nextInt();
			System.out.println(a+b);
		}
	}
}

  

Guess you like

Origin www.cnblogs.com/Vivianwang/p/10968583.html