Advertisement
STANAANDREY

9not10 48

Jan 21st, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.  int x,prec,MAX=0,MAXg=0;
  6.  cin>>x;prec=x;
  7.  do
  8. {
  9.    cin>>x;
  10.     if (MAX<x)
  11.         MAX=x;
  12.     if (MAXg<x)
  13.         MAXg=x;
  14.     if (!x)
  15.     {
  16.         cout<<"MAX:"<<MAX<<endl;
  17.         MAX=0;prec=x;
  18.         cin>>x;
  19.          if (MAX<x)
  20.         MAX=x;
  21.         if (MAXg<x)
  22.         MAXg=x;
  23.     }
  24.  
  25. } while (prec!=0||x!=0);
  26. cout<<"MAXg:"<<MAXg;
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement