HDU 4706 Children\'s Day
2016-04-21 18:53
330 查看
http://vjudge.net/contest/view.action?cid=53024#problem/Ahttp://acm.hdu.edu.cn/showproblem.php?pid=4706
Total Submission(s): 1266 Accepted Submission(s): 812
[align=left]Problem Description[/align]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').
[align=left]Input[/align]This problem has no input.
[align=left]Output[/align]Output different 'N' from size 3 to size 10. There is no blank line among output.
[align=left]Sample Output[/align][pre]a e bdf c gh n
i mo
jl p
k q
.........
r j
[/pre]
Hint
Not all the resultsare listed in the sample. There are just some lines. The ellipsis expresseswhat you should write.
[/i]
[align=left]Source[/align]2013 ACM/ICPC Asia Regional Online —— Warmup
[align=left]Recommend[/align]liuyiding | We have carefully selected several similar problems for you: 5177 5176 5175 5173 5172
这道题我感觉是模拟,因为是模拟| / |的画法进行写程序的,还是听好写的,当然也有人打表把这些字母都打出来也行。
Children's Day
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1266 Accepted Submission(s): 812
[align=left]Problem Description[/align]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.
a e bdf c 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').
[align=left]Input[/align]This problem has no input.
[align=left]Output[/align]Output different 'N' from size 3 to size 10. There is no blank line among output.
[align=left]Sample Output[/align][pre]a e bdf c gh n
i mo
jl p
k q
.........
r j
[/pre]
Hint
Not all the resultsare listed in the sample. There are just some lines. The ellipsis expresseswhat you should write.
[/i]
[align=left]Source[/align]2013 ACM/ICPC Asia Regional Online —— Warmup
[align=left]Recommend[/align]liuyiding | We have carefully selected several similar problems for you: 5177 5176 5175 5173 5172
#include<iostream> #include<cstring> #include<algorithm> #include<cstdlib> #include<vector> #include<cmath> #include<stdlib.h> #include<iomanip> #include<list> #include<deque> #include<map> #include <stdio.h> #include <queue> #define maxn 10000+5 #define ull unsigned long long #define ll long long #define reP(i,n) for(i=1;i<=n;i++) #define rep(i,n) for(i=0;i<n;i++) #define cle(a) memset(a,0,sizeof(a)) #define mod 90001 #define PI 3.141592657 const ull inf = 1LL << 61; const double eps=1e-5; using namespace std; bool cmp(int a,int b){ return a>b; } char a[110][110]; int main() { //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); int num=0; for(int i=3;i<=10;i++) { memset(a,'0',sizeof(a)); for(int j=1;j<=i;j++) { if(num==26)num=0; a[j][1]=num+'a'; num++; } int j=i-1,k=2; while(j>=2&&k<=i-1) { if(num==26)num=0; a[j--][k++]=num+'a'; num++; } for(int j=1;j<=i;j++) { if(num==26)num=0; a[j][i]=num+'a'; num++; } for(int p=1;p<=i;p++) { for(int q=1;q<=i;q++) if(a[p][q]=='0')cout<<" "; else cout<<a[p][q]; cout<<endl; } } return 0; }
这道题我感觉是模拟,因为是模拟| / |的画法进行写程序的,还是听好写的,当然也有人打表把这些字母都打出来也行。
相关文章推荐
- HDU 1551 Cable master
- HDU 4708 Rotation Lock Puzzle
- Difference Between Primes----素数筛选
- HDU 1669 & poj 3122 pie
- 测试作业
- Redis数据库安装部署
- 编译ffmpeg with gpu
- 105. Construct Binary Tree from Preorder and Inorder Traversal
- 【尺取】POJ 3320
- do-until随机求十个数的和
- Objective-C学习笔记(三)——用Objective-C编写第一个程序:Hello,World!
- Codeforces Round #260 (Div. 2) 第一题A. Laptops
- HDU1789 Doing Homework again(贪心)
- 【转载】HDU 2844.Coins(多重背包转01背包)
- CodeForces - 552A Vanya and Table (水)
- 背包问题模版
- Coderforces练习---水题
- 闰年!
- 动态规划入门 DP基础
- windows 控制台下的时钟