Rakibul_Ahasan

Uva->12015 - Google is Feeling Lucky

Oct 10th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int t;
  7.     cin>>t;
  8.     for(int i=1;i<=t;i++){
  9.  
  10.         char s[10][100];
  11.         int ar[100];
  12.         int max=0;
  13.  
  14.         for(int j=0;j<10;j++){
  15.             cin>>s[j];
  16.             cin>>ar[j];
  17.  
  18.             if(max<ar[j]){
  19.                 max=ar[j];
  20.             }
  21.         }
  22.  
  23.         cout<<"Case #"<<i<<":"<<endl;
  24.  
  25.         for(int j=0;j<10;j++){
  26.             if(max==ar[j]){
  27.                 cout<<s[j]<<endl;
  28.             }
  29.         }
  30.     }
  31.     return 0;
  32. }
Add Comment
Please, Sign In to add comment