電腦軟體程式C&C++一個問題小弟初學不懂上來發問

著一題要怎麼解???看起很簡當對初學沒看過的很難麻煩有好心人教導一下

n:3 n:5

* *

** **

*** ***

****

*****

1 Answer

Rating
  • 8 years ago
    Favorite Answer

    #include <stdio.h>

    #include <stdlib.h>int main(void)

    {

    int n;

    int i,j;

    scanf("%d",&n);

    for(i=0;i<n;i++){ for(j=0;j<n;j++)

    j>=n-i-1 ? putchar('*'): putchar(' ');

    putchar('\n'); } system("pause");

    return 0;

    }

    參考看看

    Source(s): 自己
    • Login to reply the answers
Still have questions? Get your answers by asking now.