Advertisement
cosenza987

Untitled

Oct 1st, 2021
1,399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     //ios_base::sync_with_stdio(false);
  7.     //cin.tie(0);
  8.     int n;
  9.     scanf("%d", &n);
  10.     double cur = 11;
  11.     char ans[1000];
  12.     while(n--) {
  13.         char a[1000];
  14.         double prob;
  15.         scanf("%s", a);
  16.         scanf("%lf", &prob);
  17.         if(prob < cur) {
  18.             memcpy(ans, a, sizeof(a));
  19.             cur = prob;
  20.         }
  21.     }
  22.     printf("%s", ans);
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement