/* This program reads two lines from standard input, and then compares them. */ #include using namespace std; int main() { string s1, s2; if (getline(cin, s1)) { // Read the two lines. if (getline (cin, s2)) { if (s1 < s2) { // Test whether the first is less than the second. cout << "Less than" << endl; } else if (s1 > s2) { // Test whether the first is greater than the second. cout << "Greater than" << endl; } else { // Otherwise, they are equal cout << "Equal" << endl; } } } return 0; }