hdu 4706 Children's Day
来源:互联网 发布:淘宝寄到国外怎么收费 编辑:程序博客网 时间:2024/06/05 04:11
Children's Day
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 163 Accepted Submission(s): 76
Problem Description
Today is Children's Day. Some children ask you to output a big letter 'N'. 'N' is constituted by two vertical linesand one diagonal. Each pixel of this letter is a character orderly. No tail blank is allowed.
For example, this is a big 'N' start with 'a' and it's size is 3.
Your task is to write different 'N' from size 3 to size 10. The pixel character used is from 'a' to 'z' continuously and periodic('a' is reused after 'z').
For example, this is a big 'N' start with 'a' and it's size is 3.
a ebdfc g
Your task is to write different 'N' from size 3 to size 10. The pixel character used is from 'a' to 'z' continuously and periodic('a' is reused after 'z').
Input
This problem has no input.
Output
Output different 'N' from size 3 to size 10. There is no blank line among output.
Sample Output
[pre]a ebdfc gh ni mojl pk q.........r j[/pre]HintNot all the resultsare listed in the sample. There are just some lines. The ellipsis expresseswhat you should write.#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;#define N 12char a[N][N],ch='a'-1;char getChar(){ ++ch; if(ch>'z')ch-=26; return ch;}void output(int n){ int i,j; for(i=0;i<n;i++) for(j=0;j<n;j++) a[i][j]=' '; for(i=0;i<n;i++)a[i][0]=getChar(); for(i=n-2;i>0;i--)a[i][n-i-1]=getChar(); for(i=0;i<n;i++)a[i][n-1]=getChar(); for(i=0;i<n;i++){ for(j=0;j<n;j++)printf("%c",a[i][j]); printf("\n"); }}int main(){ for(int i=3;i<=10;i++){ output(i); } system("pause");return 0;}
- hdu 4706 Children's Day
- hdu 4706 Children's Day
- Hdu 4706 Children's Day
- HDU 4706 Children's Day
- HDU 4706 Children's Day
- HDU 4706 Children\'s Day
- hdu 4706 Children's Day
- HDU 4706:Children's Day
- hdu 4706 Children's Day
- HDU 4706 Children's Day
- HDU 4706 Children's Day 解题报告
- Hdu 4706 Children's Day -- 输出图形
- [ACM] hdu 4706 Children's Day
- HDU-#4706 Children's Day(模拟)
- HDU 4706 Children's Day(模拟)
- 【HDU 4706】【水题】Children's Day
- HDU 4706 Children Day
- HDU 4706 Children's Day (热身赛第一题)
- SRM 590 DIV1
- Java序列化的作用和反序列化
- 宏与内联(inline)的区别
- Linux多线程服务端编程(笔记2)
- PostQuitMessage(退出程序的一种方法)
- hdu 4706 Children's Day
- win7下如何建立ftp服务器
- hdu 4706
- 已知:yi er san si wu liu qi ba jiu 分别对应123456789,对一段只含有这几种字符的字符串进行转 换,转换成相应的数字
- 五笔必备
- Java中hashCode的作用
- c强制退出本进程自己,vc关闭自己
- 总结 使用PHP作为中间介来实现android链接远程数据库。
- HDU 4709 Herding(热身赛第四题)