Finished aoc day 3 part 1
This commit is contained in:
38
advent_of_code/2022/3/main.cpp
Normal file
38
advent_of_code/2022/3/main.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user