A - Children's Day
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
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 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.
ACcdoe:
#include <iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int aa=-1;
char ans[202][220];
void print(int a,int s){
memset(ans,' ',sizeof(ans));
for(int i=1;i<=s;++i){
a++;
a%=26;
ans[i][1]=a+'a';
//cout<<a<<'\12';
}
for(int i=1;i<s;++i){
a++;
a%=26;
ans[s-i][i+1]=a+'a';
}
a--;
for(int i=1;i<=s;++i){
a++;
a%=26;
ans[i][s]=a+'a';
}
for(int i=1;i<=s;++i){
for(int j=1;j<=s;++j)
cout<<ans[i][j];
cout<<'\12';
}
aa=a;
}
int main(){
// printf("[pre]\n");
for(int i=3;i<=10;++i)
print(aa,i);
//printf("[/pre]\n");
return 0;
}