#include <stdio.h>

#include <stdlib.h>

int main(){

    char str[1010][22]; // 二维字符数组

    int n=0,x;

    while(1){

        x=scanf("%[a-z|A-Z]",&str[n]);//用scanf函数的读入指定字符集的功能

        if(getchar()=='\n')break;//读到换行就结束

        if(x)n++;

    }

    // 倒着输出

    for(int i=n;i>=0;i--)printf("%s ",str[i]);

    return 0;

}

活动地址: 牛客春招刷题训练营 - 编程打卡活动