Finished aoc day 3 part 1

This commit is contained in:
2022-12-08 11:55:26 +01:00
parent 23a8f096b2
commit 269f9289ad
3 changed files with 344 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
#include <bits/stdc++.h>
using namespace std;
int main(){
ifstream input_file("input.txt");
string line;
unsigned int score = 0;
// while(getline(input_file, line)){
// set<char> items;
// auto l = line.length();
// for(int i = 0; i < l / 2; ++i){
// items.insert(line[i]);
// }
// for(int i = l / 2; i < l; ++i){
// if(items.find(line[i]) != items.end()){
// if(line[i] >= 'a' && line[i] <= 'z'){
// score += line[i] - 'a' + 1;
// } else{
// score += line[i] - 'A' + 1 + 26;
// }
// break;
// }
// }
// }
while(getline(input_file, line)){
}
cout << "Score: " << score << endl;
return 0;
}