Codeforces 1326B. Maximums Solution

  1. Solution in c++:
         ///**********ALLAH IS ALMIGHTY************///
         ///AH Tonmoy
        ///Department of CSE,23rd batch
        ///Islamic University,Bangladesh
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. int main()
  5. {
  6.  
  7. int v,n,c,r,t,i;
  8. while(cin>>t)
  9. {
  10. c=0;
  11. for(i=0; i<t; i++)
  12. {
  13. cin>>n;
  14. cout<<n+c<<" ";
  15. if(c<n+c)
  16. {
  17. c=n+c;
  18. }
  19. }
  20. cout<<endl;
  21. }
  22. }

No comments

Most View Post

Recent post

Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h ...

Powered by Blogger.