practice_code/c/code/idea/multiplication_table/multiplication_table_1.c

24 lines
520 B
C
Raw Normal View History

2023-12-07 21:45:29 +08:00
#include<stdio.h>
int main ()
{
int figure_1 = 1;
int figure_2 = 1;
int result;
while ( figure_1 <= 9 )
{
for ( figure_2 = 1 ; figure_2 <= figure_1 ; figure_2 ++ )
{
result = figure_1 * figure_2;
printf ( "%d*%d=%d " , figure_1 , figure_2 , result );
if ( figure_1 == figure_2 )
{
printf ( "\n" );
++ figure_1;
break;
}
}
}
return 0;
2023-12-07 19:19:14 +08:00
}