Brush(I) 水

主要是:被題意殺了......
表示原來的"\n" 沒有打,就變成了WA
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cstring>
using namespace std;
int T,n;
int  main()
{
    scanf("%d",&T);
    for(int loc=1; loc<=T; loc++)
    {
        int x;
        long long ans=0;
        scanf("%d",&n);
        for(int i=1; i<=n; i++)
        {
            scanf("%d",&x);
            if(x>0) ans+=x;
        }
        printf("Case %d: %lld\n",loc,ans);
    }
    return 0;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章