#include<stdio.h> main() { float x,amax,amin; scanf("%f",&x); amax=x;amin=x; while(x>=0) { if(x>amax)amax=x; if(x<amin)amin=x; scanf("%f",&x); } printf("\namax=%f\namin=%f\n",amax,amin); }
原文地址:http://blog.csdn.net/u013116579/article/details/38128901