MargaritaOwl

maxNum

May 14th, 2016
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. setlocale(LC_ALL, "rus");
  8.  
  9. int n, max = -2147483648, i=1;
  10. do
  11. {
  12. cout<<"a["<<i<<"] -> ";
  13. cin>>n;
  14. if (n > max)
  15. max = n;
  16. i++;
  17. } while (n != 0);
  18. cout<<"MAX = "<<max<<"\n";
  19. system("pause");
  20. return 0;
  21. }
Add Comment
Please, Sign In to add comment