代码:
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
int a, b;
printf(" |");
for (b = 1; b <= 9; b++)
{
printf("%3d",b);
}
printf("\n");
for (b = 1; b <= 10; b++)
{
printf("---");
}
printf("\n");
for (a = 1; a <= 9; a++)
{
printf("%d|",a);
for (b = 1; b <= 9; b++)
{
printf("%3d", a * b);
}
printf("\n");
}
return 0;
}
运行结果: