clean day8
This commit is contained in:
parent
ec73ef5cde
commit
d4ceb4119f
2 changed files with 0 additions and 49 deletions
BIN
day8/day8Part1
BIN
day8/day8Part1
Binary file not shown.
|
@ -1,49 +0,0 @@
|
||||||
#include <iostream>
|
|
||||||
#include <cmath>
|
|
||||||
#include <fstream>
|
|
||||||
#include <vector>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main (void)
|
|
||||||
{
|
|
||||||
string rawInput;
|
|
||||||
int valueCounter = 0;
|
|
||||||
int charCount = 0;
|
|
||||||
int lineValueCounter = 0;
|
|
||||||
bool print = false;
|
|
||||||
ifstream readFile ("data/input.txt", ios::in);
|
|
||||||
|
|
||||||
//Read file into arrays
|
|
||||||
while(getline(readFile, rawInput))
|
|
||||||
{
|
|
||||||
charCount = 0;
|
|
||||||
lineValueCounter = 0;
|
|
||||||
print = false;
|
|
||||||
for(int i=0;i<=rawInput.size();i++)
|
|
||||||
{
|
|
||||||
switch (rawInput[i])
|
|
||||||
{
|
|
||||||
case ' ':
|
|
||||||
if(charCount == 2 || charCount == 3 || charCount == 4 || charCount == 7)
|
|
||||||
{
|
|
||||||
if(print) cout << charCount << "\t";
|
|
||||||
lineValueCounter++;
|
|
||||||
}
|
|
||||||
charCount = 0;
|
|
||||||
break;
|
|
||||||
case '|':
|
|
||||||
print = true;
|
|
||||||
lineValueCounter = 0;
|
|
||||||
//cout << endl << "----------" << endl;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
charCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
valueCounter += lineValueCounter;
|
|
||||||
cout << endl << "*********" << endl << "Current Count: " << valueCounter << endl << "*********" << endl;
|
|
||||||
}
|
|
||||||
cout << valueCounter << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue