- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int a,b,c,d,i,kase=1;
- cout<<"set the number:";
- cin>>a;
- for(i=1;i<=a;i++)
- {
- b=i-1;
- c=2*a-1-2*(i-1);
- for(d=b;d>0;d--)
- {
- cout<<" ";
- }
- for(d=c;d>0;d--)
- {
- cout<<"#";
- }
- for(d=b;d>0;d--)
- {
- cout<<" ";
- }
- cout<<endl;
- }
- return 0;
- }
算法竞赛入门经典2.5 2-3倒三角形
最新推荐文章于 2021-11-12 08:00:00 发布