Advertisement
erfanul007

Light OJ 1015

Dec 29th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5. int t,i,n,x,total;
  6. scanf("%d",&t);
  7. for(i=1;i<=t;i++){
  8. scanf("%d",&n);
  9. total=0;
  10. while(n--){
  11. scanf("%d",&x);
  12. if(x>0)
  13. total+=x;
  14. }
  15. printf("Case %d: %d\n",i,total);
  16. }
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement