一道c语言题目 10
展开全部
#include <Stdio.h>
int main(void)
{
float number;
float max=0;
while(1)
{
printf("Enter a number:\t");
scanf("%f",number);
if(number>max)
{
max=number;
}
if(number<=0)
{
break;
}
}
printf("The largest number entered was %.2f\n",max);
return 0;
}
int main(void)
{
float number;
float max=0;
while(1)
{
printf("Enter a number:\t");
scanf("%f",number);
if(number>max)
{
max=number;
}
if(number<=0)
{
break;
}
}
printf("The largest number entered was %.2f\n",max);
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询