图形显示

来源:互联网 发布:班旗设计软件 编辑:程序博客网 时间:2024/05/10 12:54

问题描述

  编写一个程序,首先输入一个整数,例如5,然后在屏幕上显示如下的图形(5表示行数):
  * * * * *
  * * * *
  * * *
  * *
  *


#include<iostream>#include<cctype>using namespace std;int main(){int n;cin>>n;for(int i=0;i<n;i++){for(int j=n;j>i;j--){cout<<"* ";}cout<<endl;}return 0; }


0 0
原创粉丝点击