Wednesday, January 20, 2016

UVA 12015 - Google is Feeling Lucky

UVA 12015 - Google is Feeling Lucky


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iomanip>

using namespace std;

int main()
{
int a[10],n,i,j,t,k;
int d=1;
j=0;
char bb[10][100];
cin>>t;
while(t--)
{
for(i=0; i<10; i++)
{
cin>>bb[i];
cin>>a[i];
if(a[i]>j){
j=a[i];
}
}
cout<<"Case #"<<d<<":\n";
for(i=0; i<10; i++)
{
if(a[i]==j){
cout<<bb[i]<<endl;
}
}
d++;
j=0;
}
}

//please try first and then see the solution . if you copy and paste code you will unable to improve //your programming skill

No comments:

Post a Comment

Thank you for commenting. Please wait for response :)