Anik_Akash

max les index

Jul 17th, 2020
109
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //thanks God For Every Thing!
  2. //contest link:
  3. #include<bits/stdc++.h>
  4. #define pi                      acose(-1)
  5.  
  6. typedef long long int           ll;
  7. typedef double                  dl;
  8. using namespace std;
  9.  
  10.  
  11. int main()
  12. {
  13.     int ar[5], big;
  14.     int i, sm;
  15.     string txt[]= {"Ram","Sam","Jodu","Modhu"};
  16.     for( i=0; i<4; i++){
  17.         cin>>ar[i];
  18.     }
  19.     int sm_in=0, bi_in=0;
  20.     big = ar[0];
  21.     for(i=1; i<4; i++){
  22.         if(big<ar[i]){
  23.             big = ar[i];
  24.             bi_in = i;
  25.         }
  26.     }
  27.     sm= ar[0];
  28.     for(i=1; i<4; i++){
  29.         if(sm>ar[i]){
  30.             sm= ar[i];
  31.             sm_in=i;
  32.         }
  33.     }
  34.     cout<<txt[sm_in]<<" is younger."<<endl;
  35.     cout<<txt[bi_in]<<" is elder."<<endl;
  36.     return 0;
  37. }
RAW Paste Data