UVA1605

来源:互联网 发布:实力vip软件下载 编辑:程序博客网 时间:2024/05/18 03:52
//UVA1605BuildingForUN#include<cstdio>#include<cstdlib>#include<cstring>//类似于制定一个比赛的表格const int MAXN = 50 + 5;char a[MAXN][MAXN];int main() {int n;int cnt = 0;while(scanf("%d", &n) == 1 && n) {    if(cnt++) printf("\n");printf("%d %d %d\n", 2, n, n);for(int i = 'A'; i - 'A'< n && i <= 'Z'; i++) for(int j = 0; j < n; j++) a[i - 'A'][j] = i;for(int i = 'a'; i - 'a' < n && i <= 'z'; i++) for(int j = 0; j < n; j++) a[i - 'a' + 26][j] = i;//第一层,按行for(int i = 0; i < n; i++) {for(int j = 0; j < n; j++) printf("%c", a[i][j]);printf("\n");} //第二层,按列 printf("\n");for(int i = 0; i < n; i++) {for(int j = 0; j  < n; j++) printf("%c", a[j][i]);printf("\n");}}return 0;} /**/

原创粉丝点击