Codeforces 1326B. Maximums Solution
- Solution in c++:
///**********ALLAH IS ALMIGHTY************///
///AH Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh - #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int v,n,c,r,t,i;
- while(cin>>t)
- {
- c=0;
- for(i=0; i<t; i++)
- {
- cin>>n;
- cout<<n+c<<" ";
- if(c<n+c)
- {
- c=n+c;
- }
- }
- cout<<endl;
- }
- }
No comments