From debcd0caea344c8993c00b96d56b77ae72fff192 Mon Sep 17 00:00:00 2001 From: Oskar Date: Wed, 4 Sep 2024 14:45:36 +0200 Subject: more --- 5p21.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 5p21.cpp (limited to '5p21.cpp') 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 + +/* + * + * 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; +} -- cgit v1.2.3