level 8
永远的一点一滴
楼主
#include<stdio.h>
#include<string.h>
char* opposite(char *s);
int main(void)
{
char s[81];
char *p;
do
{
puts("input string");
gets(s);
p = opposite(s);
puts(p);
puts("put any char except q to go on");
gets(s);
}
while(*s != 'q');
return 0;
}
char* opposite(char *s)
{
char p[81];
int i;
int j = 0;
i = strlen(s);
i -= 1;
for( ;i > 0; i--,j++)
{
p[j] = s[i];
}
return p;
}

2017年04月20日 13点04分
1
#include<string.h>
char* opposite(char *s);
int main(void)
{
char s[81];
char *p;
do
{
puts("input string");
gets(s);
p = opposite(s);
puts(p);
puts("put any char except q to go on");
gets(s);
}
while(*s != 'q');
return 0;
}
char* opposite(char *s)
{
char p[81];
int i;
int j = 0;
i = strlen(s);
i -= 1;
for( ;i > 0; i--,j++)
{
p[j] = s[i];
}
return p;
}

