From c8de18ff7dcb1357007965c20588a176c44ce98e Mon Sep 17 00:00:00 2001 From: huaji233333 <42206275+huaji233333@users.noreply.github.com> Date: Mon, 30 Dec 2019 23:22:22 +0800 Subject: [PATCH] 2019.12.30 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.增加输入n的功能; 2.性能降低,,, 3.没有bug,有就打断几把 --- "\345\234\243\350\257\236\346\240\221.cpp" | 33 +++++++++------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git "a/\345\234\243\350\257\236\346\240\221.cpp" "b/\345\234\243\350\257\236\346\240\221.cpp" index e6cff5d..143dd4b 100644 --- "a/\345\234\243\350\257\236\346\240\221.cpp" +++ "b/\345\234\243\350\257\236\346\240\221.cpp" @@ -1,31 +1,26 @@ +/*https://github.com/huaji233333/urban-spoon*/ +/*v0.1-release*/ #include 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<