
程序代码:
本人来个不递归
#include <stdio.h>
#define N 100
void f (char *p, int n)
{
char *q, s;
q = p + n;
while (p < q)
s = *q, *q = *p, *p = s, -- q, ++ p;
}
int main ()
{
char a[N];
while (scanf ("%s",a))
f (a, strlen (a) - 1), puts (a);
getch ();
return 0;
}