2015
09-17

Children’s Day

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

This problem has no input.

This problem has no input.

[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.


AC代码：

#include <stdio.h>
#include <string.h>

int main() {
int a[12][30][30];
int i,j,k;
int z = 97;
for(i=3; i<=10; i++) {
for(j=0; j<i; j++) {
a[i][j][0] = z;
z++;
if(z==123)
z = 97;
}
for(j=i-2,k=1; j>=0,k<i; j--,k++) {
a[i][j][k] = z;
z++;
if(z==123)
z = 97;
}
for(j=1; j<i; j++) {
a[i][j][k-1] = z;
z++;
if(z==123)
z = 97;
}
}
for(i=3; i<=10; i++) {
for(j=0; j<i; j++) {
for(k=0; k<i; k++) {
if(a[i][j][k]>=97 && a[i][j][k]<=122)
printf("%c", a[i][j][k]);
else
printf(" ");
}
puts("");
}
}
return 0;
}