[C++ Primer] 练习3.4

2017-02-28  本文已影响0人  和平北路
#include <iostream>
#include <string>

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

int main() {
    string first;
    string second;

    cin >> first >> second;
    if (first > second) {
        cout << first << endl;
    } else if (first < second) {
        cout << second << endl;
    }

    if (first.size() > second.size()) {
        cout << first << endl;
    } else if (first.size() < second.size()) {
        cout << second << endl;
    }
}
上一篇 下一篇

猜你喜欢

热点阅读