#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> int main(){ /* 将一个字符串str的内容颠倒过来,并输出。 str的长度不超过100个字符。 */ char str[100]; gets(str); int i = 0 , j = 0; for(i = strlen(str) -1 ; i >= 0 ; i--){ printf("%c" , str[i] ); } printf("\n"); return 0; } |
Double click to view unformatted code.