#include <iostream> using namespace std; int main() { //行 for (int row = 1; row <= 9; row++) { //列 for (int column = 1; column <= row; column++) { //根据乘法表达式的结果来输出不同的格式 if ((column * row) < 10) { cout << column << "*" << row << "= " << row* column << " "; } else { cout << column << "*" << row << "=" << row* column << " "; } } cout << endl; } system("pause"); return 0; }