[Cpp]
/* Description
9. multiplication tables are the foundation of mathematics learning. Let's take a look at the problems related to multiplication tables today. The 9-9 multiplication song, also known as "9-9", is shown in. Your task is to write a program. For a given positive integer n, output the first n rows of the "9-9 multiplication table.
Input
The input contains multiple groups of test data, ending with EOF. Each group of test data contains only one positive integer n (0 <n <10 ).
Output
For each group of test data, the first n rows of the "9-9 multiplication table" are output. # Include <iostream>
*/
# Include <iostream>
/* Description
9. multiplication tables are the foundation of mathematics learning. Let's take a look at the problems related to multiplication tables today. The 9-9 multiplication song, also known as "9-9", is shown in. Your task is to write a program. For a given positive integer n, output the first n rows of the "9-9 multiplication table.
Input
The input contains multiple groups of test data, ending with EOF. Each group of test data contains only one positive integer n (0 <n <10 ).
Output
For each group of test data, the first n rows of the "9-9 multiplication table" are output. # Include <iostream>
*/
# Include <iostream>
[Cpp]
Using namespace std;
Int main ()
{
Int n, I, j;
Cin> n;
If (n <1 | n> 9)
Cout <"error" <endl;
Else
{
For (I = 1; I <= n; I ++)
{
For (j = 1; j <= I; j ++)
{
Cout <I <"*" <j <"=" <I * j <"";
}
Cout <endl;
}
}
Return 0;
}