C++打印乘法表-嗨客网

PHOTO EMBED

Thu Dec 08 2022 03:58:59 GMT+0000 (Coordinated Universal Time)

Saved by @leawoliu

#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
	cout << "嗨客网(www.haicoder.net)\n" << endl;
	//打印每一行
	int y = 1;
	for (y = 1; y <= 9; y++) 
	{
		int x = 1;
		// 打印每一行里面的每一列
		for (x = 1; x <= y; x++)
		{
			cout << x << " * " << y << " = " << x*y << " ";
		}
		//每一行之后的换行
		cout << endl;
	}
	return 0;
}
content_copyCOPY

https://haicoder.net/cpp/cpp-for-mul-table.html