Browse Source

cleanups

master
mid-kid 2 years ago
parent
commit
91f860a3d2
  1. 6
      d02.cc

6
d02.cc

@ -8,9 +8,9 @@ vector<array<unsigned, 2>> parse()
{ {
vector<array<unsigned, 2>> input; vector<array<unsigned, 2>> input;
for (string line; getline(cin, line);) { for (string line; getline(cin, line);) {
if (line.size() < 3 || line[1] != ' ') throw "parse"; if (line.at(1) != ' ') throw "parse";
unsigned oppo = line[0] - 'A'; unsigned oppo = line.at(0) - 'A';
unsigned user = line[2] - 'X'; unsigned user = line.at(2) - 'X';
if (oppo >= 3 || user >= 3) throw "parse"; if (oppo >= 3 || user >= 3) throw "parse";
input.push_back({oppo, user}); input.push_back({oppo, user});
} }

Loading…
Cancel
Save