#include<stdio.h> #include<stdlib.h> int main(){ int number,max,min,n; n=1; printf("输入第%d个数:",n); scanf("%d",&number); max=number; min=number; while(n<=4){ n++; printf("输入第%d个数:",n); scanf("%d",&number); if(number>max) max=number; else if(number<min) min=number; } printf("最大数为:%d\n",max); printf("最小数为:%d\n",min); system("pause"); return 0; }
原文:https://www.cnblogs.com/201qx/p/11878386.html