#include <iostream>
using namespace std;
class Math
{
private:
int num1;
int num2;
int num3;
int num4;
int num5;
int num6;
public:
Math (int first, int second, int third, int fourth, int fifth, int sixth);
int Largest ();
int Smallest ();
};
Math::Math (int first, int second, int third, int fourth, int fifth, int sixth)
{
num1 = first;
num2 = second;
num3 = third;
num4 = fourth;
num5 = fifth;
num6 = sixth;
return;
}
int Math::Largest ()
{
int answer;
answer = num1;
if (num2 > answer)
answer = num2;
if (num3 > answer)
answer = num3;
if (num4 > answer)
answer = num4;
if (num5 > answer)
answer = num5;
if (num6 > answer)
answer = num6;
return answer;
}
int Math::Smallest ()
{
int answer;
answer = num1;
if (num2 < answer)
answer = num2;
if (num3 < answer)
answer = num3;
if (num4 < answer)
answer = num4;
if (num5 < answer)
answer = num5;
if (num6 < answer)
answer = num6;
return answer;
}
int main()
{
Math test1 (7,69,3,4,5,6);
int solu = test1.Smallest();
cout << solu;
solu = test1.Largest();
cout << solu;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKCmNsYXNzIE1hdGgKewoJcHJpdmF0ZToKCQlpbnQgbnVtMTsKCQlpbnQgbnVtMjsKCQlpbnQgbnVtMzsKCQlpbnQgbnVtNDsKCQlpbnQgbnVtNTsKCQlpbnQgbnVtNjsKCQkKCXB1YmxpYzoKCQoJCU1hdGggKGludCBmaXJzdCwgaW50IHNlY29uZCwgaW50IHRoaXJkLCBpbnQgZm91cnRoLCBpbnQgZmlmdGgsIGludCBzaXh0aCk7CgkJCgkJaW50IExhcmdlc3QgKCk7CgkJaW50IFNtYWxsZXN0ICgpOwp9OwoKTWF0aDo6TWF0aCAoaW50IGZpcnN0LCBpbnQgc2Vjb25kLCBpbnQgdGhpcmQsIGludCBmb3VydGgsIGludCBmaWZ0aCwgaW50IHNpeHRoKQp7CgludW0xID0gZmlyc3Q7CgludW0yID0gc2Vjb25kOwoJbnVtMyA9IHRoaXJkOwoJbnVtNCA9IGZvdXJ0aDsKCW51bTUgPSBmaWZ0aDsKCW51bTYgPSBzaXh0aDsKCQoJcmV0dXJuOwp9CgppbnQgTWF0aDo6TGFyZ2VzdCAoKQp7CglpbnQgYW5zd2VyOwoJCglhbnN3ZXIgPSBudW0xOwoJCglpZiAobnVtMiA+IGFuc3dlcikgICAgIAogICAgICAgICBhbnN3ZXIgPSBudW0yOwogICAgaWYgKG51bTMgPiBhbnN3ZXIpICAgICAKICAgICAgICAgYW5zd2VyID0gbnVtMzsKICAgIGlmIChudW00ID4gYW5zd2VyKSAgICAgCiAgICAgICAgIGFuc3dlciA9IG51bTQ7CiAgICBpZiAobnVtNSA+IGFuc3dlcikgICAgIAogICAgICAgICBhbnN3ZXIgPSBudW01OwogICAgaWYgKG51bTYgPiBhbnN3ZXIpICAgICAKICAgICAgICAgYW5zd2VyID0gbnVtNjsKICAgICAgICAgCiAgICByZXR1cm4gYW5zd2VyOwp9CgppbnQgTWF0aDo6U21hbGxlc3QgKCkKewoJaW50IGFuc3dlcjsKCQoJYW5zd2VyID0gbnVtMTsKCQoJaWYgKG51bTIgPCBhbnN3ZXIpICAgICAKICAgICAgICAgYW5zd2VyID0gbnVtMjsKICAgIGlmIChudW0zIDwgYW5zd2VyKSAgICAgCiAgICAgICAgIGFuc3dlciA9IG51bTM7CiAgICBpZiAobnVtNCA8IGFuc3dlcikgICAgIAogICAgICAgICBhbnN3ZXIgPSBudW00OwogICAgaWYgKG51bTUgPCBhbnN3ZXIpICAgICAKICAgICAgICAgYW5zd2VyID0gbnVtNTsKICAgIGlmIChudW02IDwgYW5zd2VyKSAgICAgCiAgICAgICAgIGFuc3dlciA9IG51bTY7CiAgICAgICAgIAogICAgcmV0dXJuIGFuc3dlcjsKfQoKaW50IG1haW4oKSAKewoJTWF0aCB0ZXN0MSAoNyw2OSwzLDQsNSw2KTsKCWludCBzb2x1ID0gdGVzdDEuU21hbGxlc3QoKTsKCWNvdXQgPDwgc29sdTsKCXNvbHUgPSB0ZXN0MS5MYXJnZXN0KCk7Cgljb3V0IDw8IHNvbHU7CglyZXR1cm4gMDsKfQ==