第7週の任務1-4個の数の最大値と最小値を求めます
/*
* Copyright (c) 2011,
* All rights reserved.
* :
* :2012 10 8
* :v1.0
*
* :
* : ,
* :
* :
* :
*/
#include<iostream>
using namespace std;
int main()
{
int a,b,c,d;
int max0,max1,min0,min1;
cout<<" :";
cin>>a>>b;
if(a>b)
{
max0=a;min0=b;
}
else
{
max0=b;min0=a;
}
cout<<" :";
cin>>c>>d;
if(c>d)
{
max1=c;min1=d;
}
else
{
max1=d;min1=c;
}
if(max0>max1)
cout<<" "<<max0<<endl;
else
cout<<" "<<max1<<endl;
if(min0<min1)
cout<<" "<<min0<<endl;
else
cout<<" "<<min1<<endl;
return 0;
}