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').
This problem has no input.
Output different 'N' from size 3 to size 10. There is no blank line among 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.
迷失在幽谷中的鳥兒,獨自飛翔在這偌大的天地間,殊不知本身該飛往何方……
#include <iostream>
#include <cmath>
#include <stdio.h>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <iomanip>
#include <algorithm>
using namespace std;
char mp[20][20];
char nextc(char c)
{
if(c=='z')return 'a';
else return ++c;
}
int main()
{
char cur='a';
int i,j,k;
for(i=3; i<=10; i++)
{
memset(mp,' ',sizeof(mp));
for(j=0; j<i; j++)
{
mp[j][0]=cur;
cur=nextc(cur);
}
for(j=i-2,k=1; j>0; j--,k++)
{
mp[j][k]=cur;
cur=nextc(cur);
}
for(j=0; j<i; j++)
{
mp[j][i-1]=cur;
cur=nextc(cur);
}
for(j=0; j<i; j++)
{
for(k=0; k<i; k++)
printf("%c",mp[j][k]);
printf("\n");
}
}
return 0;
}