/* Example to reverse a sentence entered by user without using strings. */
#include <stdio.h>
void Reverse();
int main()
{
printf("Enter a sentence: ");
Reverse();
return 0;
}
void Reverse()
{
char c;
scanf("%c",&c);
if( c != '\n')
{
Reverse();
printf("%c",c);
}
}
如何用递归的方式颠倒字符串
最新推荐文章于 2024-01-01 15:20:55 发布