forked from jaege/Cpp-Primer-5th-Exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
3.4.cpp
33 lines (29 loc) · 778 Bytes
/
3.4.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <string>
void check_equal() {
std::string s1, s2;
if (std::cin >> s1 >> s2) {
if (s1 == s2)
std::cout << "The two strings are equal." << std::endl;
else if (s1 > s2)
std::cout << "The first string is larger." << std::endl;
else
std::cout << "The second string is larger." << std::endl;
}
}
void check_length() {
std::string s1, s2;
if (std::cin >> s1 >> s2) {
if (s1.size() == s2.size())
std::cout << "The two strings have same length." << std::endl;
else if (s1.size() > s2.size())
std::cout << "The first string is longer." << std::endl;
else
std::cout << "The second string is longer." << std::endl;
}
}
int main() {
//check_equal();
//check_length();
return 0;
}