C輸入n,輸出n層數字金字塔

2021-03-04 08:54:49 字數 2124 閱讀 6950

1樓:匿名使用者

哎連分bai也不給點

du#include "stdafx.h"

#include

using namespace std;

int main()

{int i, n,j,m,k;

cout<<"請輸入數zhi

字dao\n";

cin>>n;

for(i = 0; i < n; i++){for(m=0;m出

回cout<<' ';

for(j = 1; j <=i; ++j)//左邊答數字cout<0;--k)//右邊數字

{cout<

2樓:匿名使用者

#include

using namespace std;

int main()

cout<

}return 0;}

編寫程式輸入n的值(0

3樓:百度使用者

#include

void main()

printf("\n");}}

4樓:

clear

for i=1 to 9

for j=1 to 2*i-1 step 1??inext

?next

5樓:

免費的事情俺不會幹,免費的午餐你也別想吃!~

編寫程式輸入n的值,輸出乙個數字金字塔,怎樣寫這個c程式

6樓:聽不清啊

#include

int main()

return 0;}

7樓:匿名使用者

是不是這樣的:

#include

int main()

{int i ,j;

int n;

printf("please input a number:\n");

scanf("%d",&n);

printf("print:\n");

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

{for(j=i;j<=n-1;j++)

printf("  ");

for (j=0; j結果:

please input a number:

4print:

12 2 2

3 3 3 3 3

4 4 4 4 4 4 4*/

8樓:我回眸只為你

#include

void main()

printf("\n");}}

9樓:皇興有蓬煙

給,已經編譯執行通過:

#include

#include

void

main()

printf("\n");

}getch();}

c++語言程式設計【問題描述】編寫程式實現:輸入任意整數給n後,輸出n行由數字構成的三角形字元陣列圖形。

10樓:微俊

#include

int main()

printf("\n");

}return 0;}

11樓:匿名使用者

for(i=n;i>0;i--)

for(j=1;j<=i;j--)

c語言程式輸出數字金字塔

12樓:匿名使用者

給,已經編譯執行通過:

#include

#include

void main()

printf("\n");

}getch();}

13樓:匿名使用者

不知道你到底想輸出幾行,如果只是這幾行的換,直接輸出就行了。 在你需要加空格的地方加空格就行了。

偷懶的做法。 把#換成空格就好了!

#include

int main(void)

C語言編寫程式,實現輸入n個整數,輸出其中最小的數,並指出其是第幾個數

include void main if min v value 後面的輸入與最小值比較,小則取代最小值 printf 第 d個數最小,為 d min p,min v include define max 1000 void swap int x int y int main printf 最小數為...

c語言求解。從鍵盤輸入正整數N,再輸入N個整數,按從小

include void main for j 0 ja i 1 printf 排序後陣列為 for i 0 i printf d a i include main printf the sorted numbers n for i 0 i printf d a i include int main...

程式設計,輸入n,儲存並輸出如下例n5所示的圖形

int c 1 for int i 1 i n i else cout 程式設計輸出n行圖形 n值通過鍵盤輸入 假設n 5,則圖形如下 include void main 編寫程式,輸入整數n,輸出n行的字元圖案.例如n 5時輸出 5 include int main void return 0 i...