C++学习日记 九九乘法表打印
#include <iostream>
using namespace std;
int main()
{
int i, j,num;
for (i = 1; i <= 9; i++)
{
for (j = 1; j <= i; j++) //列数小于行数
{
num = i * j;
cout << i ;
cout << "x" ; //代替乘号
cout << j ;
cout << "=" ;
cout << num ;
cout << " ";
if (j == i) //每一行打印完进行换行
{
cout << endl;
}
}
}
system("pause");
return 0;
}