Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2022
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include <windows.h>
  2. #include <iostream>
  3. #include <iomanip>
  4. #include <string>
  5. #include <math.h>
  6.  
  7. /*
  8. #include <utility>
  9. #include <vector>
  10. #include <fstream>
  11. #include <iterator>
  12. #include <algorithm>*/
  13.  
  14. using namespace std;
  15.  
  16. ///////////////////////////////////
  17. int main(int argc, char **argv)
  18. {
  19. // Руссификация сообщений
  20.  
  21. system("chcp 1251 > nul");
  22. SetConsoleTitle(TEXT("ОтветыМейлРу")); //Для совместимости с VS
  23.  
  24. int a=0;
  25. do
  26. {
  27. cout << "Input INT by 1 to 9..." << endl;
  28. while (!(cin >> a) || (cin.peek() != '\n'))
  29. {
  30. cin.clear();
  31. while (cin.get() != '\n');
  32. cout << "Input error! Repeat please...\n" << endl;
  33. }
  34. } while (a<1 || a>9);
  35.  
  36. cout<<endl;
  37. system("pause");
  38. return 0;
  39. }
  40.  
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement