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

18
2020/puzzle-01-01.cc Normal file
View File

@@ -0,0 +1,18 @@
#include <iostream>
#include <string>
#include <vector>
int main(int argc, char **argv) {
std::vector<int> vals;
for (std::string line; std::getline(std::cin, line);) {
int val = std::stoi(line, nullptr, 10);
for (auto v : vals) {
if (v + val == 2020) {
std::cout << v << " * " << val << " = " << v * val << "\n";
}
}
vals.push_back(val);
}
return 0;
}