Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. setlocale (LC_ALL, "Russian");
  8.  
  9.     int chiselko = 0;
  10.     int count = 1;
  11.     int max=-2147483648;
  12.     int number =0;
  13.     do
  14.  
  15.     {
  16.   cin>> chiselko;
  17. if (!cin)
  18. {
  19. cout<<("Не число");
  20. return 1;
  21. }
  22.  
  23. if (chiselko>max && chiselko!=0)
  24. {
  25. max=chiselko;
  26. number = count;
  27.  
  28.  
  29. }
  30. count ++;
  31.     }
  32.  while (chiselko!=0 );
  33.  cout<< "Самое большое значение = " <<max << " с номером "<< number ;
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement