diff --git a/week7/KCM/[W7]_11867.cpp b/week7/KCM/[W7]_11867.cpp new file mode 100644 index 0000000..42a5360 --- /dev/null +++ b/week7/KCM/[W7]_11867.cpp @@ -0,0 +1,15 @@ +#include +using namespace std; + +int main() { + int N, M; + + cin >> N >> M; + + if (N % 2 == 0 || M % 2 == 0) { + cout << 'A'; + } + else { + cout << 'B'; + } +} \ No newline at end of file diff --git a/week7/KCM/[W7]_9935.cpp b/week7/KCM/[W7]_9935.cpp new file mode 100644 index 0000000..4124fe9 --- /dev/null +++ b/week7/KCM/[W7]_9935.cpp @@ -0,0 +1,28 @@ +#include +#include +using namespace std; + +int main() { + const string emptyStr = "FRULA"; + string s, explodeStr; + string result; + int explodeSize; + + cin >> s; + cin >> explodeStr; + + explodeSize = explodeStr.size(); + + for (auto chr : s) { + result += chr; + + if (result.size() >= explodeSize && result.substr(result.size() - explodeSize, explodeSize) == explodeStr) { + result.erase(result.size() - explodeSize, explodeSize); + } + } + + if (result == "") + result = emptyStr; + + cout << result; +} \ No newline at end of file