mirror of
https://github.com/xlucn/PAT.git
synced 2026-02-07 03:22:15 +08:00
21 lines
263 B
C
21 lines
263 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
int main()
|
|
{
|
|
char s[82], *p;
|
|
|
|
scanf("%[^\n]", s);
|
|
|
|
for (p = s + strlen(s) - 1; p >= s; p--) {
|
|
if (*(p - 1) == ' ')
|
|
printf("%s ", p);
|
|
if (p == s)
|
|
printf("%s", p);
|
|
if (*p == ' ')
|
|
*p = '\0';
|
|
}
|
|
|
|
return 0;
|
|
}
|