Untitled

 avatar
unknown
plain_text
10 months ago
536 B
12
Indexable
#include <iostream>

using namespace std;

int ab,cd,ef,z1,z2,z3,u1,u2,u3,S1,S2,S3;

int main()
{
    cin >> ab >> cd >> ef;
    z1=(ab/10)%10;
    u1=ab%10;
    S1=z1+u1;

    z2=(cd/10)%10;
    u2=cd%10;
    S2=z2+u2;

    z3=(ef/10)%10;
    u3=ef%10;
    S3=z2+u2;

    if ((S1>S2) && (S3>S2)) {
        cout << ab;
        cout << ef;
    }
    else if ((S1>S3) && (S2>S3)) {
        cout << ab;
        cout << cd;
    }
    else {
        cout << cd;
        cout << ef;
    }

    return 0;
}
Editor is loading...
Leave a Comment