1 #include<stdio.h> 2 int main() 3 { 4 float x, max, min; 5 scanf("%f", &x); 6 max = min = x; 7 while (x > 0) 8 { 9 if (x > max) 10 max = x; 11 if (x < min) 12 min = x; 13 scanf("%f", &x); 14 } 15 printf(" max=%f min=%f ", max, min); 16 getchar(); 17 return 0; 18 }