fork download
  1. #include <stdio.h>
  2.  
  3. main() {
  4. int n = 2048;
  5. int i = 1;
  6. while (i < n) {
  7. i *= 2;
  8. }
  9. if (i == n) {
  10. printf("Y""\n");
  11. }
  12. else {
  13. printf("N""\n");
  14. }
  15. char a[5] = "ITMO";
  16. printf("%s", a);
  17. printf("\n");
  18. char temp;
  19. for (int i = 0; i < 2; i++) {
  20. temp = a[i];
  21. a[i] = a[4-i];
  22. a[4-i] = temp;
  23. }
  24. {
  25. for(int i = 1; i < 5; i++)
  26. printf("%c", a[i]);
  27. }
  28. printf("\n");
  29. for (int j = 0; j < 5; j++) {
  30. a[j] = tolower(a[j]);
  31.  
  32. printf("%c", a[j]);
  33.  
  34. }
  35. char t;
  36. int c = 0;
  37. for (i = 0; i < 4; i++) {
  38. t = a[i];
  39. a[i] = a[i + 1];
  40. a[i + 1] = t;
  41. c += 1;
  42. }
  43. printf("\n");
  44. printf("%d", c);
  45. }
Success #stdin #stdout 0s 4536KB
stdin
Standard input is empty
stdout
Y
ITMO
OMTI
omti
4