#include<stdio.h>
int main()
{
int i,j,k;
for (i=1; i<=5; i++) {
for (j=0; j<5-i; j++) {
printf(" ");
}
for (k=1; k<=2*i-1; k++) {
printf("*");
}
printf("\n");
}
printf("-------------------\n");
for (i=5; i>=1; i--) {
for (j=0; j<5-i ; j++) {
printf(" ");
}
for (k=1; k<=2*i-1; k++) {
printf("*");
}
printf("\n");
}
printf("打印99乘法表、\n");
for (i=1; i<10; i++) {
for (j=1; j<=i ; j++) {
printf("%d*%d=%2d ",j,i,i*j);
}
printf("\n");
}
} |
|