當前位置:首頁 » 編程語言 » c語言求最高分

c語言求最高分

發布時間: 2023-05-23 12:12:45

c語言輸入10個學生的成績,輸出最高分和最低分.編寫函數max求最高分,min函數求最

考察循環結構,比較簡單的一道題目,程序如下 :

#include<stdio.h>

int main()

{

int max=0,min=200,s,i;

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

{

scanf("%d",&s);

if(max<=s)

{

max=s;

}

if(min>=s)

{

min=s;

}

}
printf("最大值為%d ",max);

printf("最小值為%d ",min);

}

熱點內容
安卓備忘錄怎麼轉蘋果去 發布:2025-07-14 20:57:16 瀏覽:114
加密貨幣app 發布:2025-07-14 20:46:57 瀏覽:553
醫院防汛演練方案與腳本 發布:2025-07-14 20:41:11 瀏覽:777
公網ip做域伺服器地址 發布:2025-07-14 20:40:13 瀏覽:52
php獲取幾 發布:2025-07-14 20:22:20 瀏覽:376
舊安卓如何刷入最新安卓 發布:2025-07-14 20:16:14 瀏覽:763
伺服器或網路不給力是什麼意思 發布:2025-07-14 20:15:36 瀏覽:318
爬網站資料庫 發布:2025-07-14 20:15:20 瀏覽:520
邵雍的演算法 發布:2025-07-14 20:13:49 瀏覽:119
離線燒錄加密 發布:2025-07-14 20:12:13 瀏覽:620