UVa 490 Rotating Sentences (water ver.)

  • 阿里云国际版折扣https://www.yundadi.com

  • 阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6


    490 - Rotating Sentences

    Time limit: 3.000 seconds

    http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show_problem&problem=431

    In ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the input sentences from left to right and top to bottom, your program will display them from top to bottom and right to left.

    Input and Output

    As input to your program, you will be given a maximum of 100 sentences, each not exceeding 100 characters long. Legal characters include: newline, space, any punctuation characters, digits, and lower case or upper case English letters. (NOTE: Tabs are not legal characters.)

    The output of the program should have the last sentence printed out vertically in the leftmost column; the first sentence of the input would subsequently end up at the rightmost column.

    Sample Input


    Rene Decartes once said, "I think, therefore I am."


    Sample Output


    "R Ie n te h iD ne kc ,a r tt he es r eo fn oc re e s Ia i ad m, . "


    注意短句子后面要输出空格。


    完整代码:

    /*0.012s*/
    
    #include<cstdio>
    #include<cstring>
    #include<algorithm>
    using namespace std;
    
    char in[110][110];
    int len[110];
    
    int main(void)
    {
    	int i, j, idx = 0, Max = 0;
    	while (gets(in[idx]))
    	{
    		len[idx] = strlen(in[idx]);
    		Max = max(Max, len[idx++]);
    	}
    	for (j = 0; j < Max; j++)
    	{
    		for (i = idx - 1; i >= 0; i--)
    			putchar(j < len[i] ? in[i][j] : ' ');
    		putchar('\n');
    	}
    }



  • 阿里云国际版折扣https://www.yundadi.com

  • 阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

    “UVa 490 Rotating Sentences (water ver.)” 的相关文章

    Java8中Stream流求最大值最小值

    文章目录 java中各种类型用Stream流求最大值最小值一、BigDecimal 求最大值和最小值1. stream().reduce()实现2. stream().max()或stream().min()实现 二、Integer 求最大值和最小值1. stream().reduce...

    python排序

    from __future__ import division a = [1,3,2,4] print a a.sort() a.reverse() print a avg = sum(a)/len(a) print '平均值:%f' % avg dic = {'a':1 , 'b':2 , 'c'...

    Python怎么实现实时跟随微信窗口移动的GUI界面 - 开发技术

    本篇内容介绍了“Python怎么实现实时跟随微信窗口移动的GUI界面”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!Python写一些简单的GUI界面也是非常简单的,并且...

    微信小程序中怎么使用store数据共享 - 开发技术

    这篇文章主要介绍“微信小程序中怎么使用store数据共享”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“微信小程序中怎么使用store数据共享”文章能帮助大家解决问题。全局数据共享 全局数据共享(状态管理)是为了解决组件之间数据...

    一分钟让你了解什么是HIP

    HippoHIP是一场彻底的去中心化社区实验目标是构造一个完全由社区驱动的DAO组织。无团队份额、无私募70%全部分散空投给社区5%根据贡献发放给社区志愿者25%用于创设初始交易流动池并销毁私钥。   HIP是一张奖券每天都有几率获得Cycan生态各类代币空投   HIP是Hippo社区的治理代币社...

    aop注解简单日志

    mport java.lang.reflect.Method; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotati...