任意输入三个数 输出最大值最小值 如何编写?
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int test[3];
printf("请输入3个整数\n");
for(int i=0; i<3; i++) {
printf("第 %d 个 ",i+1);
scanf("%d",&test[i]);
}
printf("最大数 %d\n", (test[0] > (test[1] > test[2] ? test[1] : test[2]) ? test[0] : (test[1] > test[2] ? test[1] : test[2])));
printf("最小数 %d\n", (test[0] < (test[1] < test[2] ? test[1] : test[2]) ? test[0] : (test[1] < test[2] ? test[1] : test[2])));
return 0;
}