#include<stdio.h>
int main()
{
int cnt=0,n;
float max,x;
printf("the maximum value will be computed.\n");
printf("how many numbers do you wish to enter?");
scanf("%d",&n);
while(n<=0)
{
printf("\nERROR: Positive integer reguired.\n");
printf("\nHow many numbers do you wish to enter?.");
scanf("%d",&n);
}
printf("\n enter %d real numbers: \n",n);
scanf("%f",&x);
max=x;
while(++cnt<n)
{
scanf("%f",&x);
if(max<x)
max=x;
}
printf("\nMaximum value:%g\n",max);
return 0;
}
这段程序里 while(++cnt<n)
{
scanf("%f",&x);
if(max<x)
max=x;
}
这部分不太明白 请帮忙解释一下 多谢