UVA490 - Rotating Sentences
来源:互联网 发布:车床圆弧编程 编辑:程序博客网 时间:2024/05/17 03:20
问题描述
将输入的句子当初矩阵后顺时针旋转90度后输出
思路
二维数组存储字符,之后根据需求逐一输出,并且以长度最长的字符串作为矩阵的一边。
代码
#include <cstdio>#include <cstring>#include <iostream>using namespace std;int main(){ char a[110][110]; int str,line=0,i,j,maxn=0; memset(a,' ',sizeof(a)); while(gets(a[line])) { str=strlen(a[line]); if(maxn<=str) maxn=str; line++; } for(i=0;i<maxn;i++) { for(j=line-1;j>=0;j--) { if(a[j][i]==0) printf(" "); else printf("%c",a[j][i]); } printf("\n"); } return 0;}
0 0
- uva490 Rotating Sentences
- uva490 - Rotating Sentences
- UVa490 Rotating Sentences
- UVa490 - Rotating Sentences
- UVA490 Rotating Sentences
- UVA490 - Rotating Sentences
- uva490 Rotating Sentences
- UVA490—— Rotating Sentences
- UVa490 - Rotating Sentences-字符串-难度2
- Rotating Sentences
- Rotating Sentences
- Rotating Sentences
- Rotating Sentences
- Rotating Sentences
- Rotating Sentences
- Rotating Sentences
- Rotating Sentences
- Rotating Sentences
- CSU 1203 Super-increasing sequence
- 视频直播相关问题
- 源码-Spark Rpc通信源码分析
- JPG png GIF BMP图片格式的区别
- Java总结篇系列:Java泛型
- UVA490 - Rotating Sentences
- iD - OpenStreetMap的友好的JavaScript编辑器
- java中三大集合类Map,Set,List的详细介绍
- 不是匹配
- 【C++】用sort函数产生的段错误问题
- CSU 1204 Rectangles
- Redis深入之路(九)
- android中的Styles
- android xutil 使用详解