Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
918 B
1
Indexable
Never

#include <iostream>
using namespace std;


//ostream &operator<< (ostream& out,const aboba &a) {
//   out << a.name << " " << a.surname;
//   return out;
//}
int max(int a,int b,int c,int d,int ma) {
    
    for (int i = 0; i !=4 ; i++)
    {
        if (a > b && a > c && a > d)ma = a;
        if (b > a && b > c && b > d)ma = b;
        if (c > b && c > a && c > d)ma = c;
        if (d > b && d > c && d > a)ma = d;
    }
    return ma;
}

int min(int a, int b, int c, int d, int mi) {
    if (a < b && a <c && a < d)mi = a;
    if (b < a && b < c && b < d)mi = b;
    if (c < b && c < a && c < d)mi = c;
    if (d < b&& d < c && d < a)mi = d;
    return mi;
}

int main()
{
    
    int a,b,c,d ;
    int mi = 0, ma = 0;
    //int temp, f =0;
    cin >> a>>b>>c>>d;
    cout << min (a,b,c,d,mi)<<endl;
    cout << max(a, b, c, d, ma);
    
    
   
    
  

}