UVA 400(p127)----Unix Is
来源:互联网 发布:为什么玩lol网络不稳定 编辑:程序博客网 时间:2024/06/05 02:37
#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>#define debuusing namespace std;int col,row,n;string name[1000];void output(const string& st,int len){ cout<<st; int l=st.length(); for(int i=0; i<len-l; i++) printf(" ");}int main(){#ifdef debug freopen("in.in","r",stdin);#endif // debug while(scanf("%d",&n)!=EOF) { printf("------------------------------------------------------------\n"); int m=0,num=0; for(int i=0; i<n; i++) { cin>>name[i]; int tmp=name[i].length(); m=max(m,tmp); } sort(name,name+n); col=(60-m)/(m+2)+1; row=(n-1)/col+1; for(int i=0; i<row; i++) { for(int j=0; j<col; j++) { int num=j*row+i; if(num<n) output(name[num],j==col-1?m:m+2); } printf("\n"); } } return 0;}题目地址:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=6&page=show_problem&problem=341
0 0
- UVA 400(p127)----Unix Is
- UVA 400 unix is
- UVA 400 Unix is
- UVa 400 Unix Is
- Unix Is - uva 400
- Unix is(Uva 400)
- UVA 400 Unix Is
- UVA 400-Unix Is
- UVA 400 Unix is 命令
- UVA 400 Unix的Is命令
- 例题5-8 UVA 400 Unix Is命令
- uvaoj-400:Unix Is
- UVa 400 - Unix ls
- uva 400 Unix ls
- UVA 400 - Unix ls
- uva 400 - Unix ls
- uva-400-Unix ls
- UVa 400 - Unix ls
- An iterative image registration technique with an application to stereo vision笔记
- swift基本语法(总结提炼版)之010 swift 之函数
- 2015年我走过的日子
- js中trim的实现
- 项目检出JRE问题(Unbound classpath container: 'JRE System Library [JavaSE-1.7]' in project 'idweb')
- UVA 400(p127)----Unix Is
- spring的学习小结6_bean的生命周期
- linux中fork()函数详解
- [20160225] 太空工程师入门 / LOL 10级 / 股票走势预测
- UVA 401(p48)----Palindromes
- Simulated Annealing
- LeetCode:1 Two Sum
- SQLiteConnectionPool学习笔记
- 关于导入安卓工程后R文件丢失的解决办法