Advertisement
Guest User

3304

a guest
Oct 24th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.   string a;
  6.   string b;
  7.   cin >> a;
  8.   cin >> b;
  9.   if (a.size() > b.size())
  10.   {
  11.     cout << "a=" << a << endl;
  12.   }
  13.   else
  14.   {
  15.     if (a.size() < b.size())
  16.     {
  17.       cout << "b=" << b << endl;
  18.     }
  19.     else
  20.     {
  21.       for (int i = 0; i < a.size(); i++)
  22.       {
  23.         if (a[i] > b[i])
  24.         {
  25.           cout << "a=" << a << endl;
  26.           return 0;
  27.         }
  28.         if (a[i] < b[i])
  29.         {
  30.           cout << "b=" << b << endl;
  31.           return 0;
  32.         }
  33.       }
  34.       cout << "EQUALS";
  35.     }
  36.   }
  37.   return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement