[code:1]/*打印以下图形
*****
*****
*****
*****
*****
*/
#define m 5
#define n 9
main()
{
char a[m][n]={{'*','*','*','*','*',' ',' ',' ',' '},{' ','*','*','*','*','*',' ',' ',' '},
{' ',' ','*','*','*','*','*',' ',' '},{' ',' ',' ','*','*','*','*','*',' '},{' ',' ',' ',' ','*','*','*','*','*'}};
int i,j;
for(i=0;i<m;i++)
{for(j=0;j<n;j++)
printf("%c",a[i][j]);
printf("\n");
}
}
[/code:1]
这类题目只有这一种做法么?有没有方便一点的,要是想打印一个大点的那不累死?呵呵!:)谢谢指教!:) |