當前位置:首頁 » 編程語言 » c語言倒金字塔編程

c語言倒金字塔編程

發布時間: 2025-08-16 11:59:25

1. c語言程序輸出數字金字塔

給,已經編譯運行通過:
#include<conio.h>拿指局
#include<stdio.h>

void main()
{
int n;//這個就是定義的你需要輸出的行數
int i,j;

printf("please input the n: ");
scanf("%d",&n);//輸入需要輸出的行數

for(i=0;i<n;i++)
{
for(j=0;j<2*(n-1-i);j++) printf(" ");
for(j=0;j<=i;j++) printf("逗含%d",j+1);
for(j=0;j<2*i-1;j++) printf(" "消讓);
for(j=i+1;j>0;j--)
{
if(i==0) break;
printf("%d",j);
}

printf("\n");
}

getch();
}

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:585
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:881
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:574
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:761
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:677
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:1005
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:249
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:108
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:799
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:705