您的位置:首页 > 编程语言 > C语言/C++

C++实验4-项目3:乘法口诀表

2016-04-25 11:35 337 查看
一、问题及代码
#include<iostream>
using namespace std;
int main()
{
int i,j;
for(j=1;j<=6;j++)
cout<<" ";
cout<<"*"<<endl;
for(i=1;i<=5;i++)
{
for(j=1;j<=6-i;j++)
cout<<" ";
cout<<"*";
for(j=1;j<=-1+2*i;j++)
cout<<" ";
cout<<"*";
cout<<endl;
}
for(j=1;j<=13;j++)
cout<<"*";
cout<<endl;
return 0;
}


二、运行结果



三、心得体会

代码越来越难,新学的结构还是不太会使用。

四、知识点总结

运用了穷举法的思想,用循环嵌套的模式,外加水平制表格式进行对乘法口诀表的打印。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: