Sort by

recency

|

2007 Discussions

|

  • + 0 comments

    include

    using namespace std;

    int max(int a, int b) { return (a > b) ? a:b; }

    int main() { int a,b, c ,d ; cin >> a; cin >> b; cin >> c; cin >> d; int solonnhat = max(max(a,b), max(c,d)); cout << solonnhat << endl; return 0; }

  • + 0 comments
    int getMax (vector<int> nums){
        int max = INT_MIN; //#include <limits.h>
        
        for(int i : nums){
            if(i > max) max = i;
        }
        return max;
    }
    
    int main() {
        vector<int> nums;
        int a;
        
        for(int i = 0; i < 4; ++i){
            cin >> a;
            nums.push_back(a);
        }
        
        cout << getMax(nums);
        
        
        return 0;
    }
    
  • + 0 comments
    #include <cmath>
    #include <cstdio>
    #include <vector>
    #include <iostream>
    #include <algorithm>
    //using namespace std;
    
    
    int main() {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT */
        int winner {};
        for (int i = 0; i < 4; i++) {
            int current {};
            std::cin >> current;
            
            if (current > winner)
            {
              winner = current;  
            };
        }
        std::cout << winner;    
        return 0;    
    }
    
  • + 0 comments

    include include include include using namespace std;

    int max_four_num(int a, int b, int c,int d){
        if(a>b && a>c && a>d){
            return a;
        }
        else if (b>a && b>c && b>d){
            return b;
        }
        else if(c>a && c>b && c>d){
            return c;
        }
        else{
             return d;
        }
    }
    

    int main() { int a;int b; int c;int d; cin>>a>>b>>c>>d; int r=max_four_num(a,b,c,d); cout<

    return 0;
    

    }

  • + 0 comments

    include

    include

    include

    include

    using namespace std;

    int max_four_num(int a, int b, int c,int d){
        if(a>b && a>c && a>d){
            return a;
        }
        else if (b>a && b>c && b>d){
            return b;
        }
        else if(c>a && c>b && c>d){
            return c;
        }
        else{
             return d;
        }
    }
    

    int main() { int a;int b; int c;int d; cin>>a>>b>>c>>d; int r=max_four_num(a,b,c,d); cout<

    return 0;
    

    }