| 5 | 1/1 | 返回列表 |
| 查看: 551 | 回復: 4 | |||
[求助]
急求。」蚯螅。∏笾ィ。。。。 已有1人參與
|
|
1編寫程序~分別計算整數(shù)1~N之間的偶數(shù)和奇數(shù)的和,要求N的值通過鍵盤輸入 2編寫~輸入一批學生的成績(輸入-1結束),要求輸出最高分最低分和平均分 [ 發(fā)自手機版 http://www.gaoyang168.com/3g ] |

木蟲 (正式寫手)
|
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; } |

金蟲 (小有名氣)

| 5 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 08工科275分求調(diào)劑 +5 | AaAa7420 2026-03-31 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 省雙一流重點一本大學招收調(diào)劑 +3 | wwwwffffff 2026-03-31 | 5/250 |
|
|
[考研] 375求調(diào)劑 +7 | 雨夏整夜 2026-03-29 | 7/350 |
|
|
[考研] 304求調(diào)劑 +8 | 素年祭語 2026-03-31 | 11/550 |
|
|
[考研] 254材料與化工求調(diào)劑 +3 | 翰冬林楠 2026-03-30 | 4/200 |
|
|
[考研] 0710生物學求調(diào)劑! +5 | 敘述文 2026-03-31 | 5/250 |
|
|
[考研] 0856 335分 | 封裝or激光加工 老師看看我! +9 | cccchenso 2026-03-29 | 9/450 |
|
|
[考研] 271求調(diào)劑 +5 | 勒布朗@ 2026-03-31 | 7/350 |
|
|
[考研] 英一數(shù)一總分334求調(diào)劑 +4 | 陳陽坤 2026-03-31 | 4/200 |
|
|
[考研] 293分求調(diào)劑,外語為俄語 +5 | 加一一九 2026-03-31 | 5/250 |
|
|
[考研] 一志愿西交288化工專碩求調(diào)劑 +4 | 好運好運接接 2026-03-24 | 4/200 |
|
|
[考研] 本科211總分289,08工學真心求調(diào)劑 +3 | utopiaE 2026-03-30 | 3/150 |
|
|
[考研] 0703化學321分求調(diào)劑 +10 | 三dd. 2026-03-30 | 11/550 |
|
|
[有機交流] 考研調(diào)劑 +8 | watb 2026-03-26 | 8/400 |
|
|
[考研] 328求調(diào)劑 +8 | 嗯滴的基本都 2026-03-27 | 8/400 |
|
|
[考研] 一志愿北京工業(yè)大學,324分求調(diào)劑 +6 | 零八# 2026-03-28 | 6/300 |
|
|
[考研] 330一志愿中國海洋大學 化學工程 085602 有讀博意愿 求調(diào)劑 +3 | wywy.. 2026-03-27 | 4/200 |
|
|
[考研] 305求調(diào)劑 +5 | 哇盧卡庫 2026-03-26 | 5/250 |
|
|
[考研] 081200-11408-276學碩求調(diào)劑 +3 | 崔wj 2026-03-26 | 3/150 |
|
|
[考研] 打過很多競賽,085406控制工程300分,求調(diào)劑 +3 | askeladz 2026-03-26 | 3/150 |
|