• + 0 comments
    #include <bits/stdc++.h>
    using namespace std;
    
    int greatest(int a, int b, int c, int d){
        int result;
        result = a>b && a>c && a>d ? a : (b>a && b>c && b>d ? b : ( c>a && c>b&& c>d ? c : d ) ) ;
        return result;
    }
    
    int main(){
        int a,b,c,d, res;
        cin>>a>>b>>c>>d;
        res = greatest(a,b,c,d);
        cout<<res<<endl;
        return 0;
    }