Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main() {
- string s[11];
- int ar[11],mx=0,a=0,ind[11],tc;
- scanf("%d",&tc);
- for(int j=1; j<=tc; j++) {
- a=0;
- mx=0;
- memset(ind,0,sizeof(ind));
- for(int i=0; i<10; i++) {
- cin>>s[i];
- scanf(" %d",&ar[i]);
- if(ar[i]>=mx) {
- mx=ar[i];
- ind[a++]=i;
- }
- }
- int z=ind[a-1];
- int ans=ar[z];
- printf("Case #%d:\n",j);
- for(int i=1; i<a; i++) {
- int x=ind[i];
- if(ar[x]==ans) {
- cout<<s[x]<<endl;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement