Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. /******************************************************************************
  2.  
  3.                               Online C++ Compiler.
  4.                Code, Compile, Run and Debug C++ program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <iostream>
  10.  
  11. using namespace std;
  12.  
  13. int main()
  14. {
  15. setlocale (LC_ALL, "Russian");
  16.  
  17.     int chiselko = 0;
  18.     int count = 1;
  19.     int max=0;
  20.     int number =0;
  21.     do
  22.  
  23.     {
  24.   cin>> chiselko;
  25. if (!cin)
  26. {
  27. cout<<("Не число");
  28. return 1;
  29. }
  30.  
  31. if (chiselko>max)
  32. {
  33. max=chiselko;
  34. number = count;
  35.  
  36.  
  37. }
  38. count ++;
  39.     }
  40.  while (chiselko!=0 );
  41.  cout<< "Самое большое значение = " <<max << " с номером "<< number ;
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement