Skip to content

Commit

Permalink
Update ex3_4a.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooophy committed Jun 21, 2015
1 parent c49dd60 commit 26a5af8
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions ch03/ex3_4a.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
// If not, report which of the two is larger.
#include <iostream>
#include <string>

using std::string;
using std::cin;
using std::cout;
using std::endl;

int main()
{
string str1, str2;
while (cin >> str1 >> str2)
{
if (str1 == str2)
cout << "The two strings are equal." << endl;
else
cout << "The larger string is " << ((str1 > str2) ? str1 : str2);
}
string str1, str2;
while (cin >> str1 >> str2)
{
if (str1 == str2)
cout << "The two strings are equal." << endl;
else
cout << "The larger string is " << ((str1 > str2) ? str1 : str2);
}

return 0;
return 0;
}

0 comments on commit 26a5af8

Please sign in to comment.