Advertisement
filashkov

Untitled

Dec 24th, 2019
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. // CODEFORCES1281B.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
  2. //
  3.  
  4. #include <iostream>
  5. #include <string>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     int n;
  12.     cin >> n;
  13.     for (int i = 0; i < n; i++)
  14.     {
  15.         string s, c;
  16.         cin >> s >> c;
  17.         if (s < c)
  18.         {
  19.             cout << s << endl;
  20.             continue;
  21.         }
  22.         int j = 0;
  23.         for ( ; ; j++)
  24.         {
  25.             if (s[j] >= c[j])
  26.             {
  27.                 break;
  28.             }
  29.         }
  30.     }
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement