Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream in("pic.in");
- ofstream out("pic.out");
- int main()
- {
- int c,x,n,gr,s,i,smax=0,GR;
- in>>c;
- if(c==1)
- {
- in>>n;
- for(gr=1;gr<=n;gr++)
- {
- s=0;
- for(i=1;i<=gr;i++)
- {
- in>>x;
- s=s+x;
- }
- if(s>smax)
- {
- smax=s;
- GR=gr;
- }
- }
- out<<GR;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement