summaryrefslogtreecommitdiff
path: root/5p21.cpp
blob: a120ad75b0a57e77e850f81e554b78ddc682ecc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;
}