Advertisement
DBP625

Untitled

Apr 4th, 2022
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1.  
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. int main()
  5. {
  6. int t,x;
  7. cin>>t;
  8. for(int i=1;i<=t;i++)
  9. {
  10. int x;
  11. cin>>x;
  12. int sum=0;
  13.  
  14. for(int j=1;j<=x;j++)
  15. {
  16. int y;
  17. if(y>=0)
  18. {
  19. cin>>y;
  20. sum=(sum+y);
  21. }
  22. }
  23. cout<<"Case"<<" "<<i<<":"<<" "<<sum<<endl;
  24. }
  25. return 1;
  26. }
  27.  
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement