fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. void print_reverse(char s)
  4. {
  5. size_t len = strlen(s);
  6. char t = s + len -1;
  7. while(t >= s)
  8. {
  9. printf("%c", *t);
  10. t = t - 1;
  11. }
  12. puts("");
  13. }
  14.  
  15. int main()
  16. {
  17. char x[40];
  18. puts("Введи строку \n");
  19. fgets(x, 39, stdin);
  20. print_reverse(x);
  21. return 0;
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, or enum expected
#include <stdio.h>
         ^
Main.java:2: error: illegal character: '#'
#include <stdlib.h>
^
Main.java:6: error: class, interface, or enum expected
char t = s + len -1;
^
Main.java:7: error: class, interface, or enum expected
while(t >= s)
^
Main.java:10: error: class, interface, or enum expected
t = t - 1;
^
Main.java:11: error: class, interface, or enum expected
}
^
Main.java:13: error: class, interface, or enum expected
}
^
Main.java:18: error: class, interface, or enum expected
puts("????? ?????? \n");
^
Main.java:19: error: class, interface, or enum expected
fgets(x, 39, stdin);
^
Main.java:20: error: class, interface, or enum expected
print_reverse(x);
^
Main.java:21: error: class, interface, or enum expected
return 0;
^
Main.java:22: error: class, interface, or enum expected
}
^
13 errors
stdout
Standard output is empty