SHARE
TWEET

lightoj - 1015 - Brush (I)

jakaria_hossain Jul 31st, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. int main()
  5. {
  6.    int t,c;
  7.    cin>>t;
  8.    for(c=1;c<=t;c++)
  9.    {
  10.        int n,x,sum=0;
  11.        cin>>n;
  12.        for(int j=0;j<n;j++)
  13.        {
  14.            cin>>x;
  15.            if(x>=0)
  16.            sum+=x;
  17.        }
  18.        cout<< "Case "<<c<< ": "<<sum<<endl;
  19.    }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top