题解 | 多组_一维数组_T组形式

多组_一维数组_T组形式

https://www.nowcoder.com/practice/90cdc8e31ef74b6e9fd44c1e03077b57

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        sc.nextLine();
        for(int i = 0;i< t;i++){
            int n = sc.nextInt();
            sc.nextLine();
            long sum = 0;
            for(int j = 0;j<n;j++){
                long num = sc.nextLong();
                sum = sum + num;
            }
            System.out.println(sum);
        }
        sc.close();
    }
}

全部评论

相关推荐

点赞 评论 收藏
分享
06-12 16:00
天津大学 Java
牛客30236098...:腾讯坏事做尽,终面挂是最破防的 上次被挂了后我连简历都不刷了
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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