三角

来源:互联网 发布:处理器调度算法 编辑:程序博客网 时间:2024/04/28 15:57
#include <iostream>using namespace std;int main(){    int i,j;    i=1;    while(i<=6)    {        for(j=1;j<=2*(6-i)+1;++j)            cout<<"*";            for(j=1;j<=i-1;++j)            cout<<" ";        cout<<endl;        ++i;    }    return 0;}


输出结果:

 

学习总结:我只把上面的程序段落顺序倒了一下,节约时间

0 0
原创粉丝点击