n1、n2、n3、n4是一组需要找出最大最小值的整数
#include <>
int main()
{
int n1, n2, n3, n4, max1, max2, min1, min2, max, min;
n1 = 38;
n2 = 43;
n3 = 10;
n4 = 90;
if (n1 >= n2)
{
max1 = n1;
min1 = n2;
}
else
{
min1 = n1;
max1 = n2;
}
if (n3 >= n4)
{
max2 = n3;
min2 = n4;
}
else
{
max2 = n4;
min2 = n3;
}
if (max1 >= max2)//大的和大的比较
max = max1;
else max = max2;
if (min1 >= min2)//小的和小的比较
min = min2;
else min = min1;
printf("%d\n", max);
printf("%d", min);
}