![]() |
#2
ditg2020-06-13 23:59
|

#include"stdio.h"
#define QW "quit"
char *ar(char *p){
char *q;
int i;
i=1;
for(*(p+strlen(p)-i);*p;q++,i++)
*q=*(p+strlen(p)-i);
*q='\0';
return q;
}
int main(void){
char *t;
char *w;
t=(char *)malloc(sizeof(char)*100);
printf("输入字符串:");
while(strcmp(gets(t),QW)){
w=ar(t);
printf("%s\n",w);
printf("输入字符串:");
}
return 0;
}
#define QW "quit"
char *ar(char *p){
char *q;
int i;
i=1;
for(*(p+strlen(p)-i);*p;q++,i++)
*q=*(p+strlen(p)-i);
*q='\0';
return q;
}
int main(void){
char *t;
char *w;
t=(char *)malloc(sizeof(char)*100);
printf("输入字符串:");
while(strcmp(gets(t),QW)){
w=ar(t);
printf("%s\n",w);
printf("输入字符串:");
}
return 0;
}