summaryrefslogtreecommitdiff
path: root/5p20.cpp
diff options
context:
space:
mode:
Diffstat (limited to '5p20.cpp')
-rw-r--r--5p20.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/5p20.cpp b/5p20.cpp
new file mode 100644
index 0000000..3dbb40f
--- /dev/null
+++ b/5p20.cpp
@@ -0,0 +1,30 @@
+#include <iostream>
+
+/*
+ *
+ * 5.20
+ *
+ *
+ */
+
+int main () {
+
+ std::string s;
+ std::string tmp;
+ bool b = false;
+ while(std::cin >> s) {
+ if(tmp == s) {
+ b = true;
+ break;
+ }
+ tmp = s;
+ }
+
+ if(b) {
+ std::cout << tmp << std::endl;
+ } else {
+ std::cout << "There were no repeating words" << std::endl;
+ }
+
+ return 0;
+}