水题,统计大于0的和。
#include<cstdio>
int main(){
int t, n, tmp;
scanf("%d", &t);
for(int i = 1;i <= t;i ++){
scanf("%d", &n);
int sum = 0;
for(int j = 0;j < n;j ++){
scanf("%d", &tmp);
sum += tmp > 0 ? tmp : 0;
}
printf("Case %d: %d\n", i, sum);
}
}