题目描述

 输入一批学生的成绩(整数),输出最高分。 

输入

 输入包含多个非负整数和一个负整数。该负数不作为有效成绩,只表示输入结束。 

输出

 输出一个整数,即最高分。单独占一行。 

样例输入

 7 6 5 9 2 -1

样例输出

9

提示

 ...

来源

* 

#include<stdio.h> 
#include<limits.h>  //....tou  wenjian
 
 
int main() 

    int score, max; 
 
    max = INT_MIN; 
 
    while( scanf("%d", &score), score >= 0) //逗号表达式 
    { 
        if(score > max) 
            max = score; 
    } 
 
    printf("%d\n", max); 
    return 0; 

相关文章:

  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-06-02
  • 2022-02-12
猜你喜欢
  • 2021-06-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
  • 2021-09-24
  • 2021-11-15
相关资源
相似解决方案