Rakibul_Ahasan

Uva->12015 - Google is Feeling Lucky

Oct 10th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.45 KB | None | 0 0
  1. /***
  2. **     Author: Rakibul Ahasan Papon
  3. **     Bangladesh University of Business and Technology,
  4. **     Dept. of CSE.
  5. ***/
  6.  
  7. #include<bits/stdc++.h>
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12.     int t;
  13.     cin>>t;
  14.     for(int l=1; l<=t; l++)
  15.     {
  16.         char a[100],b[100],c[100],d[100],e[100],f[100],g[100],h[100],i[100],j[100];
  17.         int v[100],max=0;
  18.  
  19.             cin>>a>>v[0];
  20.             cin>>b>>v[1];
  21.             cin>>b>>v[2];
  22.             cin>>d>>v[3];
  23.             cin>>e>>v[4];
  24.             cin>>f>>v[5];
  25.             cin>>g>>v[6];
  26.             cin>>h>>v[7];
  27.             cin>>i>>v[8];
  28.             cin>>j>>v[9];
  29.  
  30.  
  31.         for(int k=0; k<10; k++)
  32.         {
  33.             if(max<v[k])
  34.                 max=v[k];
  35.         }
  36.  
  37.                 cout<<"Case #"<<l<<":"<<endl;
  38.                 if(max==v[0])
  39.                     cout<<a<<endl;
  40.                 if(max==v[1])
  41.                     cout<<b<<endl;
  42.                 if(max==v[2])
  43.                     cout<<c<<endl;
  44.                 if(max==v[3])
  45.                     cout<<d<<endl;
  46.                 if(max==v[4])
  47.                     cout<<e<<endl;
  48.                 if(max==v[5])
  49.                     cout<<f<<endl;
  50.                 if(max==v[6])
  51.                     cout<<g<<endl;
  52.                 if(max==v[7])
  53.                     cout<<h<<endl;
  54.                 if(max==v[8])
  55.                     cout<<i<<endl;
  56.                 if(max==v[9])
  57.                     cout<<j<<endl;
  58.     }
  59. }
Add Comment
Please, Sign In to add comment