From 69ffbce9c945a93acbaf2f9c6421178ba2f4977f Mon Sep 17 00:00:00 2001 From: Jihoon Lee Date: Wed, 13 Mar 2024 09:14:57 +0900 Subject: [PATCH] Add 02975.cpp --- 02xxx/02975.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 02xxx/02975.cpp diff --git a/02xxx/02975.cpp b/02xxx/02975.cpp new file mode 100644 index 00000000..2ab51ca5 --- /dev/null +++ b/02xxx/02975.cpp @@ -0,0 +1,19 @@ +#include +#include +using namespace std; + +bool solve(void) { + int a, b; char c; cin >> a >> c >> b; + if (a == 0 && b == 0 && c == 'W') return false; + + cout << (c == 'D' ? to_string(a+b) : (a + 200 < b ? "Not allowed" : to_string(a-b))) << "\n"; + return true; +} + +int main(void) { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + while (solve()); + return 0; +} \ No newline at end of file