vitormartinotti

Lista de Chamada OBI

Sep 2nd, 2026
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. vector<string> lista;
  6.  
  7. int main()
  8. {
  9.     int n, k; scanf("%d %d", &n, &k);
  10.    
  11.     for(int i = 1; i <= n; i++){
  12.         string nome;
  13.         cin >> nome;
  14.         lista.push_back(nome);
  15.     }
  16.    
  17.     sort(lista.begin(),lista.end());
  18.    
  19.     cout << lista[k-1];
  20.    
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment