fork download
  1. # include <stdio.h>
  2. # include <math.h>
  3. int main()
  4. {
  5. double n;
  6. double s;
  7. int i = 0;
  8. int flag = 0;
  9. scanf("%lf",&n);
  10. if( n == 0||n == 1){
  11. flag = 1;
  12. }
  13. if(n > (double)1){
  14. for(i = 0; i <(int) n/2; i++){
  15. s = pow(2,(double)i);
  16. if( s == n){
  17. flag = 1;
  18. break;
  19. }
  20. }
  21. }
  22. if(flag == 0){
  23. printf("NIE\n");
  24. }else if(flag == 1){
  25. printf("TAK\n");
  26. }
  27.  
  28. return 0;
  29. }
Runtime error #stdin #stdout 0.02s 4272KB
stdin
Standard input is empty
stdout
Standard output is empty