Alvin asked in 電腦與網際網路軟體 · 1 decade ago

C語言 圖形

請問我要如何讓我的圖形方向換成另一邊??

這是我的程式碼

#include<stdio.h>

#include<stdlib.h>

int main(void)

{

int i,j,k,n;

scanf("%d",&n);

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

{

for(j=1;j<=i;j++)printf(" ");

for(k=0;k<n;k++)printf("*");

printf("\n");

}

system("pause");

return 0;

}

拜託大大了!!

1 Answer

Rating
  • 1 decade ago
    Favorite Answer

    # include < stdio.h >

    # include < stdlib.h >

    int main ( int argc, char *argv[] )

    {

    int i, j, k, n ;

    scanf( " %d ", &n);

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

    {

    for ( j = n - 1 ; j > i ; j-- )

    printf(" ");

    for ( k = 0 ; k < n ; k++)

    printf("*");

    puts("");

    }

    }

    Source(s):
Still have questions? Get your answers by asking now.