首页 > 代码库 > UVa1605 Building for UN (构造法)
UVa1605 Building for UN (构造法)
链接:http://vjudge.net/problem/51167
分析:
2 2 2
AB
CC
zz
zz
2 8 8
aaaaaaaa
bbbbbbbb
cccccccc
dddddddd
eeeeeeee
ffffffff
gggggggg
hhhhhhhh
abcdefgh
abcdefgh
abcdefgh
abcdefgh
abcdefgh
abcdefgh
abcdefgh
abcdefgh
1 #include <cstdio> 2 3 int n; 4 5 int main() { 6 while (scanf("%d", &n) == 1) { 7 printf("2 %d %d\n", n, n); 8 for (int i = 0; i < n; i++) { 9 for (int j = 0; j < n; j++)10 putchar(i < 26 ? ‘a‘ + i : ‘A‘ + i - 26);11 printf("\n");12 }13 14 printf("\n");15 for (int i = 0; i < n; i++) {16 for (int j = 0; j < n; j++)17 putchar(j < 26 ? ‘a‘ + j : ‘A‘ + j - 26);18 printf("\n");19 }20 printf("\n");21 }22 return 0;23 }
UVa1605 Building for UN (构造法)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。