您的位置:首页 > 其它

蓝桥杯算法训练 图形显示

2018-03-28 10:00 302 查看
算法训练 图形显示  时间限制:1.0s   内存限制:512.0MB    问题描述  编写一个程序,首先输入一个整数,例如5,然后在屏幕上显示如下的图形(5表示行数):
  * * * * *
  * * * *
  * * *
  * *
  *c++代码:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=n;i>0;--i){
for(int j=0;j<i;++j)
cout<<"* ";
cout<<endl;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: