-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmumbling_main.cpp
More file actions
32 lines (28 loc) · 878 Bytes
/
mumbling_main.cpp
File metadata and controls
32 lines (28 loc) · 878 Bytes
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
/*
7 kyu
Mumbling
https://www.codewars.com/kata/5667e8f4e3f572a8f2000039
*/
#include <iostream>
#include <string>
class Accumul {
public:
static std::string accum(const std::string& s);
};
static void do_test(const std::string& s, const std::string& expected) {
std::string actual = Accumul::accum(s);
std::cout << "String : \"" << s << "\"" << std::endl
<< "Expected: \"" << expected << "\"" << std::endl
<< "Actual : \"" << actual << "\"" << std::endl
<< "-> " << (expected == actual ? "OK" : "FAIL") << std::endl
<< std::endl;
}
int main() {
do_test("ZpglnRxqenU",
"Z-Pp-Ggg-Llll-Nnnnn-Rrrrrr-Xxxxxxx-Qqqqqqqq-Eeeeeeeee-Nnnnnnnnnn-"
"Uuuuuuuuuuu");
do_test("NyffsGeyylB",
"N-Yy-Fff-Ffff-Sssss-Gggggg-Eeeeeee-Yyyyyyyy-Yyyyyyyyy-Llllllllll-"
"Bbbbbbbbbbb");
return 0;
}