summaryrefslogtreecommitdiff
path: root/3p4.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3p4.cpp')
-rw-r--r--3p4.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/3p4.cpp b/3p4.cpp
new file mode 100644
index 0000000..2545618
--- /dev/null
+++ b/3p4.cpp
@@ -0,0 +1,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;
+}