#include <stdio.h>
#include <stdlib.h>
int main()
{int max,min,num;
printf("Input numbers,-1 to end:\n");
scanf("%d",&num);
max=min=num;
while(num!=-1)
{
if(num>max)max=num;
if(num<min)min=num;
scanf("%d",&num);
}
printf("max:%d,min:%d\n",max,min);
system("pause");
return 0;
}
温馨提示:答案为网友推荐,仅供参考