UVa 490 - Rotating Sentences
题目:将输入的句子,反转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的更多相关文章
- 490 - Rotating Sentences
Rotating Sentences In ``Rotating Sentences,'' you are asked to rotate a series of input sentences ...
- Rotating Sentences
#include<bits/stdc++.h> #define N 110 int main(void) { char s[N][N]; int i, j, k, max; , memse ...
- 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, . ...
- 【索引】Volume 0. Getting Started
AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 0. Getting Started 10055 - Hashmat the Brav ...
- UVA题目分类
题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...
- UVA 253 Cube painting(暴力打表)
Cube painting Problem Description: We have a machine for painting cubes. It is supplied with three d ...
- UVa 10012 - How Big Is It? 堆球问题 全排列+坐标模拟 数据
题意:给出几个圆的半径,贴着底下排放在一个长方形里面,求出如何摆放能使长方形底下长度最短. 由于球的个数不会超过8, 所以用全排列一个一个计算底下的长度,然后记录最短就行了. 全排列用next_per ...
- RQNOJ 490 环形石子合并
题目链接:https://www.rqnoj.cn/problem/490 题目描述 在一个园形操场的四周摆放N堆石子,现要将石子有次序地合并成一堆.规定每次只能选相邻的2堆合并成新的一堆,并将新的一 ...
- uva 1354 Mobile Computing ——yhx
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABGcAAANuCAYAAAC7f2QuAAAgAElEQVR4nOy9XUhjWbo3vu72RRgkF5
随机推荐
- 引用计数gc机制使用不当导致内存泄漏
上一篇文章找同事review了一下,收到的反馈是铺垫太长了,我尽量直入正题,哈哈 最近dbd压测时发现内存泄漏,其实这个问题去年已经暴露了,参见这篇博客[压测周].当时排查不够仔细,在此检讨下.关于d ...
- 通过printf设置Linux终端输出的颜色和显示方式
转载自:http://www.cnblogs.com/clover-toeic/p/4031618.html 在Linux终端下调试程序时,有时需要输出大量信息.若能控制字体的颜色和显示方式,可使输出 ...
- C++ Primer : 第十三章 : 拷贝控制示例
/* Message.h */ #ifndef _MESSAGE_H_ #define _MESSAGE_H_ #include <iostream> #include <strin ...
- [JSOI2008][BZOJ1012] 最大数(动态开点线段树)
题目描述 现在请求你维护一个数列,要求提供以下两种操作: 1. 查询操作. 语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值. 限制:L不超过当前数列的长度. 2. 插入操作 ...
- pods的安装和使用
//// pods的安装.h// IOS笔记 /*Cocoapods安装步骤 1.升级Ruby环境 终端输入:$gem update --system 此时会出现 ERROR: While ex ...
- Python学习笔记——Day4
字符串操作 string典型的内置方法: count() center() startswith() find() format() lower() upper() strip() replace() ...
- mysql:字符串转换为日期类型
函数:DATE_FORMAT http://www.w3school.com.cn/sql/func_date_format.asp
- Happen-before
http://blog.csdn.net/ns_code/article/details/17348313
- ADF_Data Binding系列1_使用Bean Data Control
2015-02-16 Created By BaoXinjian
- Logistic Regression逻辑回归
参考自: http://blog.sina.com.cn/s/blog_74cf26810100ypzf.html http://blog.sina.com.cn/s/blog_64ecfc2f010 ...