标签:ann static [] can ring code == 小问题 new
import java.util.*; class Hw1 { public static void main(String[]args){ Scanner scanner=new Scanner(System.in); int a,b; while(scanner.hasNextInt()){ a=scanner.nextInt(); b=scanner.nextInt(); System.out.println(a+b); } } }
import java.util.*; class Hw2 { public static void main(String[]args){ Scanner scanner=new Scanner(System.in); int a,b,flag=0; while(scanner.hasNext()){ a=scanner.nextInt(); b=scanner.nextInt(); a=a+b; if(flag==0){ flag=1; System.out.println(a); } else System.out.println("\n"+a); } } }
标签:ann static [] can ring code == 小问题 new
原文地址:https://www.cnblogs.com/hw1988/p/10528531.html