#include <stdio.h>
reverse_string(char const * str)
{
if( *str != ‘\0‘ )
{
str++;
reverse_string( str );
printf("%c",*(str-1));
}
}
int main()
{
char *str="guruichun";
printf("原字符串为: %s\n反向排列后为:",str);
reverse_string( str );
printf("\n");
return 0;
}
时间: 2024-10-11 20:59:17