Advertisement
leminhkt

noname52

Apr 30th, 2020
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #include<time.h>
  3.  
  4.  
  5. using namespace std;
  6.  
  7.  
  8. #define sz(x) (x).size()
  9.  
  10.  
  11.  
  12.         /* ----------------- ~~~~~~~ ----------------- */
  13.  
  14.     string res, x;
  15.     int n;
  16.  
  17. /* ----------------- ~~~~~~~ ----------------- */
  18.  
  19. int main(){
  20.    
  21.     //freopen("INPUT.inp", "r", stdin);
  22.     //freopen("OUTPUT.out", "w", stdout);
  23.     //ios_base::sync_with_stdio(0); cin.tie(0);
  24.  
  25.         /* ----------------- main func ----------------- */
  26.  
  27.     for(cin >> n >> res; --n; res = (sz(x) > sz(res)) ? x : res)
  28.         cin >> x;
  29.     cout << res << '\n' << sz(res);
  30.  
  31. /* ----------------- ~~~~~~~~~ ----------------- */
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement