#include<stdio.h>
int main()
{
int i = 1, j = 1,c=1;
for (i = 1; i <= 9; i++)
{
for (j = 1; j <= i; j++)
{
c = i * j;
printf("%d*%d=%-5d", i, j, c);
}
printf("\n");
}
getchar();
getchar();
return 0;
}
结果显示如下:
#include<stdio.h>
int main()
{
int i = 1, j = 1,c=1;
for (i = 1; i <= 9; i++)
{
for (j = 1; j <= i; j++)
{
c = i * j;
printf("%d*%d=%-5d", i, j, c);
}
printf("\n");
}
getchar();
getchar();
return 0;
}
结果显示如下: