fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. bool PerftCube(long double a)
  5. {
  6. if(cbrt(a)!=floor(cbrt(a)))
  7. return false;
  8. else
  9. return true;
  10. }
  11.  
  12. bool PerftSquare(long double a)
  13. {
  14. if(sqrt(a)!=floor(sqrt(a)))
  15. return false;
  16. else
  17. return true;
  18. }
  19.  
  20.  
  21. int main()
  22. {
  23. long long a;
  24. while(cin>>a)
  25. {
  26. if(a>0)
  27. {
  28. if (PerftSquare(a) && PerftCube(a))
  29. cout<<"Special"<<"\n";
  30. else
  31. cout<<"Ordinary"<<"\n";
  32. }
  33. }
  34. return 0;
  35. }
Success #stdin #stdout 0.01s 5516KB
stdin
1
2
64
100
15625
0
stdout
Special
Ordinary
Special
Ordinary
Special