解题思路:
注意事项:
参考代码:
#include<iostream>
using namespace std;
int main()
{
cout << " " << "Nine-by-nine Multiplication Table" << endl;
cout << "--------------------------------------" << endl;
cout << " " << "1 2 3 4 5 6 7 8 9" << endl;
cout << "--------------------------------------" << endl;
for(int i = 1;i <= 9;i ++)
{
printf(" %d ",i);
for(int j = 1;j <= i;j ++)
{
int sum = i*j;
printf("%2d ",sum);
}
cout << endl;
}
cout << "--------------------------------------" << endl;
return 0;
}
0.0分
0 人评分