#include<stdio.h> #include<string.h>

int main() { char arr[80][80]; // 2D char array to store the strings char a; // To store the newline character int i; // Loop variable

// Taking input from the user until newline character is encountered
for(i=0;a!='\n';++i)
{
    scanf("%s%c",&arr[i],&a); // %c is used to capture the newline character
}

// Printing the strings in reverse order
for(i--;i>=0;i--)
{
    printf("%s",arr[i]); // Printing the string
    if(i!=0)
    printf(" "); // Adding a space between the strings
}
return 0;
#includestdioh#includestringhint main char arr8080; char a; int i; fori=0;a!=n;++i scanfsc&arri&a; fori--;i=0;i-- printfsarri; ifi!=0 printf ;

原文地址: https://www.cveoy.top/t/topic/immp 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录