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

题目:将输入的句子,反转90度后输出。

思路:第i行字符串旋转90度后,其字符为每一行的第i个字符。

 #include<iostream>
#include<cstring>
#include<cstdio>
using namespace std; int main()
{
// freopen("input.txt","r",stdin);
char cc[][];
int aa[];
string s;
int i,j=,max=,k=;
memset(cc,' ',sizeof(cc));
while(getline(cin,s))
{
for(i=;i<s.length();i++)
cc[i][k]=s[i];
if(s.length()>max)
max=s.length();
k++;
}
for(i=;i<max;i++)
{
for(j=k-;j>=;j--)
cout<<cc[i][j];
cout<<endl;
}
return ;
}

UVa 490 - Rotating Sentences的更多相关文章

  1. 490 - Rotating Sentences

     Rotating Sentences  In ``Rotating Sentences,'' you are asked to rotate a series of input sentences ...

  2. Rotating Sentences

    #include<bits/stdc++.h> #define N 110 int main(void) { char s[N][N]; int i, j, k, max; , memse ...

  3. UVA_490:Rotating Sentences

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

  4. 【索引】Volume 0. Getting Started

    AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 0. Getting Started 10055 - Hashmat the Brav ...

  5. UVA题目分类

    题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...

  6. UVA 253 Cube painting(暴力打表)

    Cube painting Problem Description: We have a machine for painting cubes. It is supplied with three d ...

  7. UVa 10012 - How Big Is It? 堆球问题 全排列+坐标模拟 数据

    题意:给出几个圆的半径,贴着底下排放在一个长方形里面,求出如何摆放能使长方形底下长度最短. 由于球的个数不会超过8, 所以用全排列一个一个计算底下的长度,然后记录最短就行了. 全排列用next_per ...

  8. RQNOJ 490 环形石子合并

    题目链接:https://www.rqnoj.cn/problem/490 题目描述 在一个园形操场的四周摆放N堆石子,现要将石子有次序地合并成一堆.规定每次只能选相邻的2堆合并成新的一堆,并将新的一 ...

  9. uva 1354 Mobile Computing ——yhx

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABGcAAANuCAYAAAC7f2QuAAAgAElEQVR4nOy9XUhjWbo3vu72RRgkF5

随机推荐

  1. ${param.origin}

    拦截器中设置未登录拦击跳转链接 response.sendRedirect(request.getContextPath() + "/loginAndRegister/loginAndReg ...

  2. Scalding初探之三:Hadoop实战

    Java版本 如果在Scala工程中混入Java类导致java版本不match,可能会抛错 java.lang.UnsupportedClassVersionError: XXX Unsupporte ...

  3. 用javaScript实现 登陆记住密码功能。

    一.先写一个存取 cookie的方法. function getCookie(cookiename) { var result; var mycookie = document.cookie; var ...

  4. 部分用到的python代码

    replace file extensions # change .htm files to .html for file in *.htm ; do mv $file `echo $file | s ...

  5. 深入分析js中的constructor 和prototype

    在javascript的使用过程中,constructor 和prototype这两个概念是相当重要的,深入的理解这两个概念对理解js的一些核心概念非常的重要. 我们在定义函数的时候,函数定义的时候函 ...

  6. rtabmap_ros安装---43

    摘要: 原创博客:转载请标明出处:http://www.cnblogs.com/zxouxuewei/ 一.前言 RTAB-Map (Real-Time Appearance-Based Mappin ...

  7. 练习2:雨淋湿了一道题,9个数字只能看清楚4个,第一个肯定不是1 [X * (Y3 + Z)]^2 = 8MN9,求出各个数字

    题目上的X代表的未知数,不一定是同一个数字. 其实这道题,直接一推敲答案就出来了,首先,积德尾数是9,说明 X*(Y3 + Z)的值尾数是3,3的因子只有1和3,所以X只有1和3候选,但是题目说第一个 ...

  8. 我的STL之旅 MyStack

    #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> us ...

  9. Android学习笔记(三)

    在手机应用中菜单是很重要的一部分,它能够以直观的界面让用户去选择,现在我们学习如何去新建一个菜单. 首先在res目录下新建一个menu文件夹,然后在menu文件夹下新建一个Android XML Fi ...

  10. ASP.NET MVC路由配置(转载自http://www.cnblogs.com/zeusro/p/RouteConfig.html )

    把apress.pro.asp.net.mvc.4.framework里的CHAPTER 13翻译过来罢了. XD 首先说URL的构造. 其实这个也谈不上构造,只是语法特性吧. 命名参数规范+匿名对象 ...