Experiment 7-3-1 String Reverse Order (15 points)

Input a string, reverse the string, and output the reversed string.

Input format:
Input a non-empty string that does not exceed 80 characters in length and ends with a carriage return in one line.

Output format:
output the reversed string in one line.

Input sample:
Hello World!
Output sample:
!dlroW olleH
title collection complete works portal

#include <stdio.h> 
#include <string.h>
int main()
{
    
    
    char a[81];
    gets(a);
    for (int i = strlen(a) - 1; i >= 0; i--)
        printf("%c", a[i]);

    return 0;
}

Guess you like

Origin blog.csdn.net/fjdep/article/details/112841362