星图
题目来源:江西理工大学OJ
题目地址:http://oj.jxust.edu.cn/problems/1216
题目描述
编写一个函数,输出如图8-6图形
输入
输出
样例输入
样例输出
这个题目教我们如何输出。。
上代码!!
#include<bits/stdc++.h>
using namespace std;
int main()
{
cout << " *" << endl;
cout << " * * *" << endl;
cout << " * * * * *" << endl;
cout << " * * * * * * *" << endl;
cout << " * * * * * * * * *" << endl;
cout << " * * * * * * * * * * *" << endl;
cout << " * * * * * * * * *" << endl;
cout << " * * * * * * *" << endl;
cout << " * * * * *" << endl;
cout << " * * *" << endl;
cout << " *" << endl;
return 0;//貌似有些大佬有别的办法,但是我用的是最笨的办法
}
知识点总结:
- 输出流
好了,每篇题解后面都附上一句话。
我都可以 我不着急 我都随你 你觉得什么时候爱我合适 那我就等你。