HDU 4706 Children's Day (水题)

时间:2020-12-11 20:00:32

Children's Day

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 158    Accepted Submission(s): 72

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.
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').

 
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 e
bdf
c g
h 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.

 
Source
 
Recommend
liuyiding
 

今天比赛的水题。

记录一发

 /* *******************************************
Author : kuangbin
Created Time : 2013年09月08日 星期日 12时16分28秒
File Name : 1001.cpp
******************************************* */ #include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <time.h>
using namespace std; char str[][];
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int cnt = ;
for(int i = ;i <= ;i++)
{
for(int j = ;j < i;j++)
{
for(int k = ;k < i;k++)
str[j][k] = ' ';
str[j][i] = ;
}
for(int j = ;j < i;j++)
{
str[j][] = 'a' + cnt;
cnt = (cnt+)%;
}
for(int j = i-;j > ;j--)
{
str[j][i--j] = 'a' + cnt;
cnt = (cnt+)%;
}
for(int j = ;j < i;j++)
{
str[j][i-] = 'a' + cnt;
cnt = (cnt+)%;
}
for(int j = ;j < i;j++)
printf("%s\n",str[j]);
} return ;
}