C语言输出九九乘法口诀表

#include 
#include 
void main(void)
{
	int i,j,x,y;
	clrscr();
	printf("\n\n  * * * 乘法口诀表 * * * \n\n");
	x=9;
	y=5;
	for(i=1;i<=9;i++)
	{
		gotoxy(x,y);
		printf("%2d ",i);
		x+=3;
	}
	x=7;
	y=6;
	for(i=1;i<=9;i++)
	{
		gotoxy(x,y);
		printf("%2d ",i);
		y++;
	}
	x=9;
	y= 6;
	for(i=1;i<=9;i++)
	{
		for(j=1;j<=9;j++)
		{
			gotoxy(x,y);
			printf("%2d ",i*j);
			y++;
		}
		y-=9;
		x+=3;
	}
	printf("\n\n");
}

你可能感兴趣的:(高级嵌入式c语言,算法,数据结构)