artemgf

Игра с камушками

Aug 5th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #define _USE_MATH_DEFINES
  2. #include <iostream>
  3. #include <conio.h>
  4. #include <string>
  5. #include <set>
  6. #include <map>
  7. #include <algorithm>
  8. #include <string>
  9. #include <math.h>
  10. #include <vector>
  11. #include <cmath>
  12. #include <sstream>
  13. #include <queue>
  14.  
  15. using namespace std;
  16.  
  17.  
  18. int main()
  19. {
  20.     char pht;
  21.     int s = 0;
  22.  
  23.     while (cin >> pht)
  24.     {
  25.         s = +(int)pht - '0';
  26.     }
  27.  
  28.     if (s % 3 == 0)
  29.         cout << 2 << endl;
  30.     else
  31.     {
  32.         cout << 1 << endl;
  33.         cout << s % 3;
  34.     }
  35.     _getch();
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment