| 24小時(shí)熱門(mén)版塊排行榜 |
| 5 | 1/1 | 返回列表 |
| 查看: 552 | 回復(fù): 4 | |||
[求助]
急求!!跪求!!求助攻!。。! 已有1人參與
|
|
1編寫(xiě)程序~分別計(jì)算整數(shù)1~N之間的偶數(shù)和奇數(shù)的和,要求N的值通過(guò)鍵盤(pán)輸入 2編寫(xiě)~輸入一批學(xué)生的成績(jī)(輸入-1結(jié)束),要求輸出最高分最低分和平均分 [ 發(fā)自手機(jī)版 http://www.gaoyang168.com/3g ] |

木蟲(chóng) (正式寫(xiě)手)
|
1. #include "stdio.h" #define N 20 /*確定n的值*/ main() { int i,p=0,t=0; for(i=1;i<=N;i+=2) p=p+i; printf("Odd number %d\n",p); for(i=2;i<=N;i+=2) t=t+i; printf("Even number %d\n",t); } 2. #include <stdio.h> typedef struct student { int no; int score; }student; int main() { student stu[100], maxstu, minstu; int i = 0; float sumScores = 0 while (scanf("%d", &stu.no) && stu.no != -1) { scanf("%d", &stu.score); sumScores = sumScores + &stu.score if (i == 0) { maxstu = stu; minstu = stu; } else { if (maxstu.score < stu.score) { maxstu = stu; } if (minstu.score > stu.score) { minstu = stu; } } i++; } printf("max student : no : %d score : %d\n", maxstu.no, maxstu.score); printf("min student : no : %d score : %d\n", minstu.no, minstu.score); printf("average : %f \n", sumScores/i); return 0; } |

金蟲(chóng) (小有名氣)

| 5 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 考研調(diào)劑 +9 | 小蠟新筆 2026-03-29 | 10/500 |
|
|---|---|---|---|---|
|
[考研] 考研材料工程351分調(diào)劑 +4 | 整個(gè)好的 2026-03-31 | 4/200 |
|
|
[考研] 材料工程085601數(shù)二英一335求調(diào)劑 +5 | 雙馬尾痞老板2 2026-03-31 | 5/250 |
|
|
[考研] 材料調(diào)劑 +9 | Eujd1 2026-03-31 | 10/500 |
|
|
[考研] 329求調(diào)劑,一志愿西北工業(yè)大學(xué),材料工程(085601) +6 | 小小機(jī)靈蟲(chóng) 2026-03-29 | 12/600 |
|
|
[考研] 求化學(xué)調(diào)劑 +12 | wulanna 2026-03-28 | 12/600 |
|
|
[考研] 343求調(diào)劑 +8 | 愛(ài)羈絆 2026-03-28 | 8/400 |
|
|
[考研] 一志愿211,335分,0856,求調(diào)劑院校和導(dǎo)師 +10 | 傾____蕭 2026-03-27 | 11/550 |
|
|
[考研] 土木304求調(diào)劑 +3 | 頂級(jí)擦擦 2026-03-31 | 3/150 |
|
|
[考研] 土木304求調(diào)劑 +4 | 兔突突突, 2026-03-31 | 5/250 |
|
|
[考研] 一志愿 南京航空航天大學(xué) ,080500材料科學(xué)與工程學(xué)碩 +5 | @taotao 2026-03-30 | 5/250 |
|
|
[考研] 吉大生物學(xué)326分求調(diào)劑 +3 | sunnyupup 2026-03-31 | 3/150 |
|
|
[考研] 本科211總分289,08工學(xué)真心求調(diào)劑 +3 | utopiaE 2026-03-30 | 3/150 |
|
|
[考研] 一志愿南昌大學(xué)324求調(diào)劑 +9 | hanamiko 2026-03-27 | 9/450 |
|
|
[考研] 求調(diào)劑,一志愿 南京航空航天大學(xué)大學(xué) ,080500材料科學(xué)與工程學(xué)碩 +6 | @taotao 2026-03-26 | 7/350 |
|
|
[考研] 343求調(diào)劑 +6 | 愛(ài)羈絆 2026-03-29 | 6/300 |
|
|
[考研] 材料求調(diào)劑一志愿哈工大324 +7 | 閆旭東 2026-03-28 | 9/450 |
|
|
[考研] 330一志愿中國(guó)海洋大學(xué) 化學(xué)工程 085602 有讀博意愿 求調(diào)劑 +3 | wywy.. 2026-03-27 | 4/200 |
|
|
[考研] 286求調(diào)劑 +4 | lim0922 2026-03-26 | 4/200 |
|
|
[考研]
|
平樂(lè)樂(lè)樂(lè) 2026-03-26 | 4/200 |
|