Advertisement
PikMike

Untitled

Jun 8th, 2016
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define pb push_back
  4. #define mp make_pair
  5. #define sz size
  6. #define ll long long
  7. #define ld long double
  8. #define fs first
  9. #define sc second
  10. #define forn(i, f, t) for(int i = f; i < t; i++)
  11. #define all(x) (x).begin(), (x).end()
  12. #define ins insert
  13.  
  14. const int INF = 2147483647;
  15. const int MOD = 1000000007;
  16. const ll INF64 = 9223372036854775807;
  17. const ld EPS = 1e-7;
  18.  
  19. using namespace std;
  20.  
  21. char res[10];
  22.  
  23. bool req(int k){
  24.     printf("%d\n", k);
  25.     fflush(stdout);
  26.     scanf("%s", res);
  27.     return (res[0] == 'y');
  28. }
  29.  
  30.  
  31. int main(){
  32.     int fl = 0;
  33.     vector<int> a = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 4, 9, 25, 36, 49};
  34.     forn(i, 0, a.sz()) fl += req(a[i]);
  35.     printf(fl > 1 ? "composite\n" : "prime\n");
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement