public class a002 {
public static void main(String[] args) {
java.util.Scanner scanner = new java.util.Scanner(System.in);
int a=scanner.nextInt();
int b=scanner.nextInt();
int c=a+b;
System.out.println(c);
}
}
public class a002 {
public static void main(String[] args) {
java.util.Scanner scanner = new java.util.Scanner(System.in);
int a=scanner.nextInt();
int b=scanner.nextInt();
int c=a+b;
System.out.println(c);
}
}
你只算了一筆,這題每個測資點有多筆測資
用 while ( scanner.hasNext() ) 包住主要程式,才會對
public class a002 {
public static void main(String[] args) {
java.util.Scanner scanner = new java.util.Scanner(System.in);
int a=scanner.nextInt();
int b=scanner.nextInt();
int c=a+b;
System.out.println(c);
}
}
你只算了一筆,這題每個測資點有多筆測資
用 while ( scanner.hasNext() ) 包住主要程式,才會對
謝謝你