Initial commit

This commit is contained in:
2021-12-01 20:31:53 +00:00
commit 2f44ccc3a7
106 changed files with 9333 additions and 0 deletions

16
2015/puzzle-01-01.cc Normal file
View File

@@ -0,0 +1,16 @@
#include <cassert>
#include <iostream>
#include <string>
int main(int argc, char **argv) {
for (std::string line; std::getline(std::cin, line);) {
int floor = 0;
for (auto c : line) {
assert(c == '(' || c == ')');
floor += (c == '(') - (c == ')');
}
std::cout << floor << "\n";
}
return 0;
}