您的位置:首页 > 其它

HDOJ 2162 Add ‘em(水题)

2018-04-09 15:57 357 查看
HDACM 2162

import java.util.Scanner;

public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int count = 1;
while(sc.hasNext()){
int n = sc.nextInt();
if (n<=0) {
break;
}
int sum = 0;
while(n-->0){
sum +=  sc.nextInt();
}
System.out.println("Sum of #"+count+++" is "+sum);
}
sc.close();
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: