The problem description output 99 multiplication table. The output format output format is shown in the following example. Multiplication sign is denoted by "*". The sample output below gives the first few lines of the output:
1*1=1
2*1=2 2*2=4
3*1=3 3*2=6 3*3=9
4*1=4 4*2=8 4*3=12 4*4=16
......
1#include <stdio.h>2 intMain () {3 intI,j,n;4 for(i=1; i<=9; i++){5 for(j=1; j<=i;j++)6printf"%d*%d=%d", i,j,i*j);7printf"\ n");8 }9}
The format is more beautiful (but the output style does not match test instructions):
1#include <stdio.h>2 intMain () {3 intI,j,n;4printf"\ n");5 for(i=1; i<=9; i++){6 for(j=1; j<=i;j++)7printf"%d*%d=%2d", i,j,i*j);8printf"\ n");9 }Ten Oneprintf"\ n");p rintf ("\ n"); A - for(i=1; i<=9; i++){ - //comment out the for loop below to output the lower left triangle the for(n=1; n<=9-I.; n++) -printf" "); - for(j=1; j<=i;j++) -printf"%d*%d=%2d", i,j,i*j); + -printf"\ n"); + } A}
C language · Multiplication table