Added day 6 (two programs. had to rewrite for the second problem). Added starter files.

This commit is contained in:
David Vereb
2022-12-08 08:42:07 -05:00
parent 6b2e3aeab5
commit b1a4398782
7 changed files with 146 additions and 0 deletions

2
2022/starter/Makefile Normal file
View File

@@ -0,0 +1,2 @@
a.out: main.cpp
clang++ -std=c++2b -g -O0 main.cpp

29
2022/starter/main.cpp Normal file
View File

@@ -0,0 +1,29 @@
#include <fstream>
#include <iostream>
#include <set>
#include <string>
#include <vector>
int main()
{
std::ifstream ifs("data.txt");
if(!ifs.is_open())
{
std::cerr << "Missing data.txt." << std::endl;
return -1;
}
unsigned long total = 0;
unsigned long total_pt2 = 0;
for(std::string line; std::getline(ifs, line); )
{
if(line == "")
continue;
}
std::cout << " Total: " << total << std::endl;
std::cout << "PT2 Total: " << total_pt2 << std::endl;
return 0;
}