fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string.h>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. // your code goes here
  9. char a[100];
  10. int len, i,j;
  11. // scanf("%s",a);
  12. gets(a);
  13. len=strlen(a);
  14. printf("%d",len);
  15. i=0;
  16. j=len-1;
  17. while(i<j)
  18. {
  19. swap(a[i],a[j]);
  20. i++;
  21. j--;
  22. }
  23. printf("%s",a);
  24. return 0;
  25. }
Compilation error #stdin compilation error #stdout 0s 15240KB
stdin
i love you
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:12:7: error: ‘gets’ was not declared in this scope
 gets(a);
       ^
stdout
Standard output is empty