summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-09-04 14:45:36 +0200
committerOskar <[email protected]>2024-09-04 14:45:36 +0200
commitdebcd0caea344c8993c00b96d56b77ae72fff192 (patch)
tree302a70280ba4c2b18744e044a92e57ecfcbc6a33
parent0963b6f2cc8f191caef88008cf296e0f8f30b918 (diff)
more
-rw-r--r--5p21.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/5p21.cpp b/5p21.cpp
new file mode 100644
index 0000000..a120ad7
--- /dev/null
+++ b/5p21.cpp
@@ -0,0 +1,33 @@
+#include <iostream>
+
+/*
+ *
+ * 5.20
+ *
+ *
+ */
+
+int main () {
+
+ std::string s;
+ std::string tmp;
+ bool b = false;
+ while(std::cin >> s) {
+ if(isupper(s[0])) {
+ 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;
+}