武汉科技大学ACM :1002: 零起点学算法66——反话连篇

Problem Description

把输入的字符按照反着顺序输出

Input

多组测试数据 
每组一行(每组数据不超过200个字符)

Output

按照输入的顺序反着输出各个字符

Sample Input

I am a boy.

Sample Output

.yob a ma I
#include<stdio.h>
#include <string.h>
int main()
{
    int l,i,n;
    char a[201];
    while(gets(a)!=NULL)
    {
        l=strlen(a);
        for (i=0;i<=l-1;l--)
            printf("%c",a[l-1]);
        printf("
");
        
    }
    
    return 0;
}
原文地址:https://www.cnblogs.com/liuwt365/p/4159524.html