#include <iostream> #include <string.h> using namespace std; int main(){ char c[101]; cin>>c; int len = strlen(c); for(int j=n-1;j>=0;j--){ printf("%c",c[j]); } return 0; } /* Main.cc: In function 'int main()': Main.cc:9:13: error: 'n' was not declared in this scope for(int j=n-1;j>=0;j--){ ^ Main.cc:8:7: warning: unused variable 'len' [-Wunused-variable] int len = strlen(c); ^ */ |
Double click to view unformatted code.