码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2014-12-12 14:35:36      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   io   ar   color   sp   for   on   

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("\n");
        
    }
    
    return 0;
}

 

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

标签:des   style   blog   io   ar   color   sp   for   on   

原文地址:http://www.cnblogs.com/liuwt365/p/4159524.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!