九乘以九 乘法口诀

乘法口诀的程序实现

简单地乘法口诀输出:

#include <iostream>
using namespace std;
void main()
{

	int i,j,result;
	for (i = 0; i < 10; i++)
	{
		for (j = 0; j <= i; j++)
		{
			result = i*j;
			cout<<i<<"*"<<j<<"="<<result<<" ";
		}
		cout<<endl;
	}
	system("pause");
}

结果:

《九乘以九 乘法口诀》

改变第二个for循环,得到整个9*9乘法列表

如下所示:

#include <iostream>
using namespace std;
void main()
{

	int i,j,result;
	for (i = 0; i < 10; i++)
	{
		for (j = 0; j < 10; j++)
		{
			result = i*j;
			cout<<i<<"*"<<j<<"="<<result<<" ";
		}
		cout<<endl;
	}
	system("pause");
}

结果:

《九乘以九 乘法口诀》

    原文作者:九宫图算法
    原文地址: https://blog.csdn.net/yang6464158/article/details/23962217
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞