满意答案
dragon9437
推荐于 2016.09.07
采纳率:46% 等级:9
已帮助:1262人
① 代码:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include
int main(int argc, char const *argv[])
{
double score, highest, lowest;
int n;
highest = -1; lowest = 1000000000;
n = 0;
while(1) {
scanf("%lf", &score);
if (score < 0.0) break;
if (highest < score) highest = score;
if (lowest > score) lowest = score;
n++;
}
printf("Total %d:\n", n);
printf(" The highest score is : %6.2f\n", highest);
printf(" The lowest score is : %6.2f\n", lowest);
return 0;
}
② 运行:
1
2
3
4
100 60 92.5 80.5 50.8 -1
Total 5:
The highest score is : 100.00
The lowest score is : 50.80追问: 表示没懂!囧
06分享举报