Rotating Sentences
- #include<bits/stdc++.h>
- #define N 110
- int main(void)
- {
- char s[N][N];
- int i, j, k, max;
- for (i = max = , memset(s, ' ', sizeof(s)); fgets(s[i], N, stdin); i++)
- if (strlen(s[i]) > max)
- max = strlen(s[i]);
- for (j = ; j < max-; j++) {
- for (k = i-; k >= ; k--)
- s[k][j] != '\n' && s[k][j] ? putchar(s[k][j]) : putchar(' ');
- printf("\n");
- }
- return ;
- }
这道题的难点在于怎么确定读取一行数据,用fgets读取数据流中的所有字符。
fgets(s,size,stdin);//从标准输入流中读取一行数据到s[]里面去。
Rotating Sentences的更多相关文章
- 490 - Rotating Sentences
Rotating Sentences In ``Rotating Sentences,'' you are asked to rotate a series of input sentences ...
- UVa 490 - Rotating Sentences
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=s ...
- 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, . ...
- UVA题目分类
题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...
- 【索引】Volume 0. Getting Started
AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 0. Getting Started 10055 - Hashmat the Brav ...
- 【英语魔法俱乐部——读书笔记】 3 高级句型-简化从句&倒装句(Reduced Clauses、Inverted Sentences) 【完结】
[英语魔法俱乐部——读书笔记] 3 高级句型-简化从句&倒装句(Reduced Clauses.Inverted Sentences):(3.1)从属从句简化的通则.(3.2)形容词从句简化. ...
- 【英语魔法俱乐部——读书笔记】 2 中级句型-复句&合句(Complex Sentences、Compound Sentences)
[英语魔法俱乐部——读书笔记] 2 中级句型-复句&合句(Complex Sentences.Compound Sentences):(2.1)名词从句.(2.2)副词从句.(2.3)关系从句 ...
- 【英语魔法俱乐部——读书笔记】 1 初级句型-简单句(Simple Sentences)
第一部分 1 初级句型-简单句(Simple Sentences):(1.1)基本句型&补语.(1.2)名词短语&冠词.(1.3)动词时态.(1.4)不定式短语.(1.5)动名词.(1 ...
- hdu 3307 Description has only two Sentences (欧拉函数+快速幂)
Description has only two SentencesTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K ...
随机推荐
- 如何调试R程序(转载)
R语言的调试重要性不言而喻,这段时间准备改进一个R的包,但由于接触R时间不长,中间的很多东西不懂,需要重新打包调试,以对里面的很多程序有深入了解,下面从几个方面分享一下我的收获. 1.准备工作 a)R ...
- quick-cocos2d-x学习笔记—定时器
定时器用的地方还是比较多的,游戏中的逻辑判断很多都是采用每帧执行.quick对于schedule的封装在scheduler这个lua文件中.如果是第一次接触quick的话,可能按照官方的api来写一个 ...
- Mysql性能监控
show processlist; show global variables like 'max_allowed_packet'; // QPS计算(每秒查询数)show global status ...
- ubuntu下git输出的颜色变化
(这些文章都是从我的个人主页上粘贴过来的,大家也可以访问我的主页 www.iwangzheng.com) 11点进家门,感觉很温暖哦. 以下是如何在用git的时候清晰的看出关键字的方法. $ vim ...
- Linux常用热键(持续更新)
(这些文章都是从我的个人主页上粘贴过来的,大家也可以访问我的主页 www.iwangzheng.com) --圣诞节怎么过, --略过. 今天装ubuntu的时候把windows覆盖了, 凌乱,TX童 ...
- DICOM:Ubuntu14环境下安装dcm4chee+oviyam2.1
背景: 之前博文DICOM:开源DICOM服务框架DCM4CHEE安装中曾介绍过在Windows7环境下安装部署dcm4chee.近期公司项目需要与部署到Linux系统的远端基于dcm4chee框架的 ...
- 如何下载google play免费应用的apk文件
到这里: http://apps.evozi.com/apk-downloader/ 一看便知.
- Windows命令行重命名文件
RENAME D:\Cache\xyz.html xyz%date:~0,4%%date:~5,2%%date:~8,2%.tar.gz
- Windows命令行提取日期时间
参考: http://elicecn.blog.163.com/blog/static/174017473200931910320556/ SET str="%date:~0,4%%date ...
- object-c面向对象2
我们知道在c#中有访问私有成员变量的get 和set方法.这个目的是用来公开实力对象的私有变量.我看了下ios的访问修饰符.也就是private,public,protected.这些基本上都和c# ...