| 5 | 1/1 | 返回列表 |
| 查看: 550 | 回復(fù): 4 | ||
[求助]
急求!跪求!求助攻。。。。 已有1人參與
|
|
1編寫程序~分別計(jì)算整數(shù)1~N之間的偶數(shù)和奇數(shù)的和,要求N的值通過鍵盤輸入 2編寫~輸入一批學(xué)生的成績(輸入-1結(jié)束),要求輸出最高分最低分和平均分 [ 發(fā)自手機(jī)版 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ā)表 | |
|---|---|---|---|---|
|
[考研] 化學(xué)308分調(diào)劑 +10 | 你好明天你好 2026-03-30 | 11/550 |
|
|---|---|---|---|---|
|
[考研] 材料科學(xué)與工程求調(diào)劑 +11 | 深V宿舍吧 2026-03-29 | 11/550 |
|
|
[考研] 311求調(diào)劑 +7 | 李芷新1 2026-03-31 | 7/350 |
|
|
[考研] 070300化學(xué)354求調(diào)劑 +15 | 101次希望 2026-03-28 | 15/750 |
|
|
[考研] 環(huán)境工程 085701,267求調(diào)劑 +13 | minht 2026-03-29 | 13/650 |
|
|
[考研] 調(diào)劑310 +13 | 溫柔的晚安 2026-03-25 | 14/700 |
|
|
[考研] 266分,求材料相關(guān)專業(yè)調(diào)劑 +10 | 哇呼哼呼哼 2026-03-30 | 12/600 |
|
|
[考研] 320分,材料與化工專業(yè),求調(diào)劑 +10 | 一定上岸aaa 2026-03-27 | 14/700 |
|
|
[考研] 085600,專業(yè)課化工原理,320分求調(diào)劑 +6 | 大饞小子 2026-03-29 | 6/300 |
|
|
[考研] 085601一志愿中山大學(xué)深圳材料工程330求調(diào)劑 +5 | pipiver 2026-03-30 | 5/250 |
|
|
[考研] 281求調(diào)劑 +5 | 亞克西good 2026-03-26 | 7/350 |
|
|
[考研] 一志愿北京化工大學(xué)材料與化工(085600)296求調(diào)劑 +25 | 稻妻小編 2026-03-26 | 25/1250 |
|
|
[考研] 303求調(diào)劑 +7 | DLkz1314. 2026-03-30 | 7/350 |
|
|
[考研] 一志愿北京工業(yè)大學(xué),324分求調(diào)劑 +6 | 零八# 2026-03-28 | 6/300 |
|
|
[考研] 070305高分子化學(xué)與物理 304分求調(diào)劑 +12 | c297914 2026-03-28 | 12/600 |
|
|
[考研] 070300化學(xué)求調(diào)劑 +4 | 起個名咋這么難 2026-03-27 | 4/200 |
|
|
[考研]
|
18419759900 2026-03-25 | 8/400 |
|
|
[論文投稿] Journal of Mechanical Science and Technology +3 | Russ_ss 2026-03-25 | 5/250 |
|
|
[考研] 調(diào)劑 +4 | 柚柚yoyo 2026-03-26 | 4/200 |
|
|
[考研] 求b區(qū)院校調(diào)劑 +4 | 周56 2026-03-24 | 5/250 |
|