diff options
author | Oskar <[email protected]> | 2024-08-30 22:00:39 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-08-30 22:00:39 +0200 |
commit | 0963b6f2cc8f191caef88008cf296e0f8f30b918 (patch) | |
tree | f4e747c3b3611ae291bb8499dda81e39e8748b76 /5p20.cpp | |
parent | 1e4270a7110858d6f5d4cdf12f37d78dc81bc7d9 (diff) |
more
Diffstat (limited to '5p20.cpp')
-rw-r--r-- | 5p20.cpp | 30 |
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; +} |