fork download
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <math.h>
  4. using namespace std;
  5.  
  6. int main() {
  7. // your code goes here
  8.  
  9. long int n = 1000000;
  10. bool prime[n+1];
  11. memset(prime, false, sizeof(prime));
  12. for(long int i=2; i<=n; i++)
  13. {
  14. if(prime[i]==false)
  15. {
  16. for(long int j=i+i; j<=n; j+=i)
  17. prime[j] = true;
  18. }
  19. }
  20.  
  21. long long int temp1, i, temp2;
  22. cin>>n;
  23. for(i=0; i<n; i++)
  24. {
  25. cin>>temp1;
  26. temp2 = sqrt(temp1);
  27. if(temp1==1)
  28. cout<<"Milk"<<endl;
  29. else if(temp2*temp2 == temp1)
  30. {
  31. if(prime[temp2]==false)
  32. cout<<"Rose"<<endl;
  33. else
  34. cout<<"Milk"<<endl;
  35. }
  36. else
  37. cout<<"Milk"<<endl;
  38. }
  39.  
  40. return 0;
  41. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:11:36: error: ‘memset’ was not declared in this scope
  memset(prime, false, sizeof(prime));
                                    ^
stdout
Standard output is empty