1015 - Brush (I)

#include<bits/stdc++.h> using namespace std; int main() { long long int i,j,k,n,T,N,sum=0; cin>>T; for(i=1;i<=T;i++) { cin>>N; sum=0; while (N--) { cin>>k; if(k>0) sum+=k; } cout<<"Case "<<i<<": "<< sum<<endl; } return 0; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.