0 like 0 dislike
請設計一個程式,利用迴圈輸出文字金字塔。

p.s. 輸入皆為奇數,且不大於20

範例輸入1:

5

範例輸出1:

  *

 ***

*****

輸入範例2:

7

輸出範例2:

   *

  ***

 *****

*******
[Exercise] Coding (C) - asked in 作業 by (18k points)
Available when: Unlimited - Due to: Unlimited
1 flag | 168 views
0 0
Called for Help
0 0
Called for Help
0 0
Called for Help
0 0
Called for Help
0 0
Called for Help

61 Answers

0 like 0 dislike
Hidden content!
#include <stdio.h>

#include<stdlib.h>



int main()





{

    int input,b,c ;




* * ** ** **** **** ** *** * * * * * *** *** *



    for(b=0;b<=input;b++)

    {
* * * * ** * * *** **** * * * *** **** ** * **
*** ** * * ** * ** **** * *** * * *** ******* * ** * * * *** * ****** ** * ");}


* * *** ** **** * * * * ** ** * **** * **** * * **** ** ** * **** * * * * * **
* * ** ** **** * * ** ***** * ** ** **** *** * **** * * * *** ***** * ** * **** ** * *** ***** **


** * ** ***** * **** * * ** *** * * ** * * *** * * *** * *** * ** ** * *** *** * * * ** ** * * *
** ** * ** * * ** ******** ** * *** * * ** ** * ******** ** *** *** *** ***** * ** **** ** * * ** *** **** ***** * ** * ** * ** *


** * ** ** * * ******* *** * ***** * * * ** * * * ** ***** * ** * * ** ** * * *


* * ** **** **** ** * * * ** ****** ** ****** ** * *** * ** ** ** * *
** * * * * * * ********** * * * 0;

    }
answered by (-85 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>
****** * ** ** *



int main()

{
** * * * ** * * * n, j, k;


* ** ****** **** *** * ** ** * * ** * * *** &n);


* * ** *** ** * **** ** * (j = 1; j <= n / 2 + 1; j ++)
* **** * **** * * ** **
* ** * *** * ** *** * * ** *** ******* * ** * = 0; k < n / 2 + 1 - j; k ++)
* ** * ***** * * ** ******** ** * * * * ***** * * * * ** ** ***** * ** **** * * ");
** *** * * ** * **** * ** ** * * ** ** * = 0; k < (j - 1) * 2 + 1; k ++)
**** ** * * ** ** **** ** *** * *** * ***** ** ** * * * ** ***
*** ** * * * *** * * * ** * *** ***** * ***** * ******* * *** *** ***** *** ***
* **** * ** * *** *


** ** ** **** ** * ** * 0;

}
answered by (-64 points)
0 like 0 dislike
Hidden content!
* * ****** * * ****
** ** ******** *

int main()

{

int * **
* ** * * ***** *** **


** ** * ** * *

{
* ** * ***** * ***


*** * * **


* * ** * ***






** * * * * * *
** * ** *** ***



}





return 0;









}
answered by (-248 points)
0 like 0 dislike
Hidden content!
** * * * *
* ** ** ** * ** **

main()

{

int a,s,sp;
**** ***** *


* * ** * * ** *

{
*** ** * * * ******


** * * * ** * *


* **** ** * * *






* ** ********* **
* * *** ** **



}















}
answered by (-248 points)
0 like 0 dislike
Hidden content!
** **** * * * **
**** ** * **

main()

{

int a,s,sp;
**** ** ** * **** **


* ***** ** *

{
*** *** * ***


* * * **** * * *


**** * * * * ***
* * * *** * *** *
*** ** *** ** *****

}

















}
answered by (-248 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>



int main() {

    

    int i,j,a=0;
* ** *** * * * ** * ***** **

    
** *** * * ******* ** ** *** * ****
* *** ** * **** * * *** * *** * ** * * ** *
* ****** * ** ** ** * ** ********* *** * * * * == 0){


* * * ** * ** ** * *** * * ******* * * *** * ** * *** ** ** * * ** **** * **
* ** ** *** * * * * * * ** ** ** **
* *** ** * * * ** ** * * ** ** *** *** * * * ** **
** * * ** ** ******* ** *** ** ** * **** * ** ** * ** **** * * * *** ");
* * * ***** * *** ****** *** ***
***** * * * *** * * ** **** * ** * * * **** * *
***** * **** * **** ***** * **** ** ** * ****** * ****** ** * * * * * * ***
** *** *** * *** ** * ** ** * * **** **
* * * * * * ** ** ** ** *** * ***** * **** * * ** ***

    }
** ** * ** * * ******* ** * ** * ***

    
* * **** * * ** ** * * * 0;

}
answered by (-126 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>
* * * ** *** **



int main()

{
*** * ** * ***** a,b,c;


* * ** *** **** ** * *** ** * ** *


* ** *** *** * * **** ******

   {
* ** ** **** ***** ** ** * * * *** *** * *
* * ** *** *** * ** * * ** * * * * ** * ****** ");
* * * ** ******* * * ** * *** ** ** ** * *** *
*** * ** * ** * * ** * * * * * **** * ** ******** * ** * *
* ********* ** * ** ****** * * ** ** *** * * * ** *** **** * * * * *

   }


* * * * *** * *** 0;

}
answered by (-124 points)
0 like 0 dislike
Hidden content!
***** ******* * * * *
* * * * ** *



int main()

{
* ** * *** ** ** * a=0,b=0,c=0;


* ** ** * *** ** * * * *******


***** * * ** = 1; b <= a / 2 + 1;b++)
* *** * ** **
*** *** *** ******* * ** * ****** = 1; c < a / 2 + 1 - b;c++)
** *** *** ** *** * * ** * * * * ***** * ** ");
* * ** ** * * * ** * *** * = 0; c < (b-1) * 2 + 1;c++)
* * ** * * *** * *** * * * * * *** * * * ** *
* * ** ** **** * * ** ** * * ** *** * * * ***** * **
** ** *** * * *


* *** ** **** * * ** ****** * * *
** *** * * * * 0;

}
answered by (-124 points)
0 like 0 dislike
Hidden content!
* ****** *** *

int main()

{
** * * * * * n, j, k;
** * * * * * *** * * * ** ****
***** * **** =1 ;j * * n / 2 + 1; j ++)
** * * *
* * * * ** * * * * * *** ** ** = 0;k < n / 2 + 1 - j;k ++)
* * * **** * ** * ** * * ****
* * ***** * * *** *** ***** * = 0;k < (j - 1) * 2 + 1;k ++)
* ** ** ** * *** * * ** * **** ** ***
* * * * ** * * ***** *** * * *****
* ** ** * * *
* * * ** **** 0;

}
answered by (-72 points)
0 like 0 dislike
Hidden content!
* * ** *

int ** *

{
**** *** ** *** **** * n,j,k ;
**** * ** * * ** * * * * * **** * ***
** ****** ** *** = 1; * n / 2 + 1; j ++)
* * **
** ***** ** = 0;k n / 2 + 1 - j ; k ++)
* *** ** * * * *** *** * * * **** ** ** *
* *** ** ***** = 0;k * ( j - 1 )* 2 + 1; k++)
* ** * * ** * ***** *** * * ** * *
***** **** *** *** ** *** *



}
* ** * * * * 0;

}
answered by (-24 points)
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.68.65.204
©2016-2019

Related questions

0 like 0 dislike
64 answers
[Exercise] Coding (C) - asked Oct 13, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 240 views
0 like 0 dislike
91 answers
[Exercise] Coding (C) - asked Oct 13, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 137 views
0 like 0 dislike
117 answers
[Exercise] Coding (C) - asked Oct 13, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 204 views
0 like 0 dislike
152 answers
[Exercise] Coding (C) - asked Oct 5, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 337 views
1 like 0 dislike
48 answers
[Exercise] Essay (Open question) - asked Nov 2, 2016 in 作業 by Shun-Po (18k points)
Available when: Unlimited - Due to: Unlimited
| 169 views
9,252 questions
85,585 answers
63,644 comments
2,714 users