Skip to content

Commit

Permalink
Add 02975.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Mar 13, 2024
1 parent c60e59b commit 69ffbce
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions 02xxx/02975.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <iostream>
#include <string>
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;
}

0 comments on commit 69ffbce

Please sign in to comment.