hdu4706

 1 #include<string.h>
 2 #include<stdio.h>
 3 int main()
 4 {
 5 int a,b,c,d,i,j,n,m;
 6 char an[15][30];
 7 for(a=3,j=0; a<=10; a++)
 8 {
 9 memset(an,' ',sizeof(an));
10 for(i=0; i<a; i++,j++)
11 {
12 an[i][0]='a'+j%26;
13 
14     }
15     for(d=1; d<=a-2; d++,j++)
16     {
17         an[i-d-1][d]='a'+j%26;
18     }
19     for(i=0; i<a; i++,j++)
20     {
21         an[i][a-1]='a'+j%26;
22     }
23     for(n=0; n<a; n++)
24     {
25         for(m=0; m<a; m++)
26             printf("%c",an[n][m]);
27             printf("
");
28     }
29 
30 }
31 }
View Code
原文地址:https://www.cnblogs.com/Osea/p/11299854.html