fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. string give(long long int n)
  5. {
  6. if(n==0)
  7. return "Special";
  8. if(n>0 && n!=0)
  9. {
  10. int ct=0;
  11. for(int i=1;i<=n;i++)
  12. {
  13. if ((n % i == 0) && (n / i == i))
  14. {
  15. int cube_root;
  16. cube_root = (int)round(pow(n, 1.0 / 3.0));
  17. if(cube_root * cube_root * cube_root == n)
  18. ct++;
  19. }
  20. }
  21. if(ct==0)
  22. return "Ordinary";
  23. else
  24. return "Special";
  25. }
  26. }
  27. int main()
  28. {
  29. long long n;
  30. while(cin >> n)
  31. {
  32. cout << give(n);
  33. cout << endl;
  34. }
  35. return 0;
  36. }
Success #stdin #stdout 0.01s 5540KB
stdin
15625
stdout
Special