summaryrefslogtreecommitdiff
path: root/3p4.cpp
blob: 2545618de53b5e225796f8a09cd9b692b83b6f24 (plain)
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
34
35
36
37
38
39
40
41
42
#include <iostream>
#include "sales_data.hpp"
#include "sales_item.hpp"

/*
 *
 * 3.4
 *
 *
 */

using std::string;
using std::cout;
using std::cin;
using std::cerr;
using std::clog;
using std::endl;
int main () {

    string word1;
	string word2;
	cin >> word1 >> word2;
	if(word1 == word2) {
		cout << word1 << " and " << word2 << " are equal! " << endl;
	} else if (word1 > word2) {
		cout << word1 << " is larger than " << word2 << endl;
	} else if (word2 > word1) {
		cout << word2 << " is larger than " << word1 << endl;
	}

	string::size_type w1 = word1.size();
	string::size_type w2 = word2.size();
	if(w1 == w2) {
		cout << word1 << " and " << word2 << " have the same length" << endl;
	} else if (w1 > w2) {
		cout << word1 << " has a longer length than " << word2 << endl;
	} else if (w2 > w1) {
		cout << word2 << " has a longer length than " << word1 << endl;
	}
	
	return 0;
}