Skip to content

Instantly share code, notes, and snippets.

@hongruiqi
Created October 29, 2013 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hongruiqi/7214994 to your computer and use it in GitHub Desktop.
Save hongruiqi/7214994 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
char p[5];
int i;
scanf("%s", p);
printf("%d\n", (int)strlen(p));
for (i=strlen(p)-1;i>=0;i--) {
printf("%c", p[i]);
}
printf("\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment