Skip to content

Commit

Permalink
Create ex5_19.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pezy committed Oct 16, 2014
1 parent 6f3f3ec commit 12972ba
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ch05/ex5_19.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <iostream>
#include <string>

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

int main()
{
string rsp;
do {
cout << "Input two strings: ";
string str1, str2;
cin >> str1 >> str2;
cout << (str1 <= str2 ? str1 : str2)
<< " is less than the other. " << "\n\n"
<< "More? Enter yes or no: ";
cin >> rsp;
} while (!rsp.empty() && rsp[0] == 'y');
return 0;
}

0 comments on commit 12972ba

Please sign in to comment.