Skip to content

Commit

Permalink
2019.12.30
Browse files Browse the repository at this point in the history
1.增加输入n的功能;
2.性能降低,,,
3.没有bug,有就打断几把
  • Loading branch information
huaji233333 authored Dec 30, 2019
1 parent ca87c9e commit c8de18f
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions 圣诞树.cpp
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
/*https://github.com/huaji233333/urban-spoon*/
/*v0.1-release*/
#include <iostream>
using namespace std;
int main()
{
int n=10;
/*for(int i=1;i<=n;i++)
{ for(int j=n;j<=n;j++)
{
cout<<" ";
}}; */
{ int n;
cin>>n;

for(int i=1;i<=n;i++)
{ for(int j=i/2;j<=n;j++)
{ if(i%2==1)
{
for(int j=(n-i)/2;j>=1;j--)
cout<<" ";
}
for(int j=n-i+1;j<=n;j++)
{
for(int q=1;q<=i;q++)
cout<<"*";
}
cout<<endl;
}
};
for(int i=1;i<=n/3;i++)
{ for(int i=1;i<=n/2-1;i++)
cout<<" ";
cout<<"| |"<<endl;
};
for(int i=1;i<=n/2;i++)
{cout<<" ";
cout<<"||"<<endl;
}



system("pause");
return 0;
}

0 comments on commit c8de18f

Please sign in to comment.