累加用long

贪心的小博

http://www.nowcoder.com/questionTerminal/0b9057782d064aeca1897bc1cfda4092

恰逢明日方舟洁哥风笛up,小博抽到了洁哥。
今天周六刷辅助大芯片精二洁哥,刷到了7个辅助大芯片,
然后又刷到了7个先锋大芯片,大抵如此:

import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception{
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long sum = 0;
        for(int i = 0; i < N; ++i) sum += sc.nextInt();
        System.out.println(sum - N + 1);
    }
}
全部评论

相关推荐

不愿透露姓名的神秘牛友
07-01 11:27
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务