Advertisement
Guest User

nxcdcdsbrgashfdjucv

a guest
Feb 28th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <fstream>
  2.  
  3. using namespace std;
  4.  
  5. ifstream in("pic.in");
  6. ofstream out("pic.out");
  7.  
  8. int main()
  9. {
  10. int c,x,n,gr,s,i,smax=0,GR;
  11. in>>c;
  12. if(c==1)
  13. {
  14. in>>n;
  15. for(gr=1;gr<=n;gr++)
  16. {
  17. s=0;
  18. for(i=1;i<=gr;i++)
  19. {
  20. in>>x;
  21. s=s+x;
  22. }
  23. if(s>smax)
  24. {
  25. smax=s;
  26. GR=gr;
  27. }
  28. }
  29. ‏‏‎ out<<GR;
  30. }
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement