Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x,prec,MAX=0,MAXg=0;
- cin>>x;prec=x;
- do
- {
- cin>>x;
- if (MAX<x)
- MAX=x;
- if (MAXg<x)
- MAXg=x;
- if (!x)
- {
- cout<<"MAX:"<<MAX<<endl;
- MAX=0;prec=x;
- cin>>x;
- if (MAX<x)
- MAX=x;
- if (MAXg<x)
- MAXg=x;
- }
- } while (prec!=0||x!=0);
- cout<<"MAXg:"<<MAXg;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement