/例【4-8】從一批以負數結束的成績中求出最高分,用while實現/
循環前先讀入一個數據,假定最大值
#include<stdio.h>
int main(void)
{
int score,max;
printf("Enter marks:");
scanf("%d",&score);
max=score;
while(score>=0)
{
if(max<score)
max=score;
scanf("%d",&score);
}
printf("Max=%d",max);
return 0;
}