#include
main()
{
char s[100][100];
int i,j;
i=0;
while (scanf(%s,s[i++])!=EOF);
for (j=i-1;j>=0;j--)
printf("%s ",s[j]);
printf("\n");
}
搜索到EOF为止
#include "stdio.h"
main()
{
char str[256];
printf("请输入英文句子:\n");
scanf("%s",str);
int len = strlen(str);
for( int i=0;i
char ch = str[i];
str[i] = str[len-i];
str[len-i] = ch;
}
printf( "倒置后是:%s",str);
getch();
}