28 lines
444 B
C++
28 lines
444 B
C++
#include <iostream>
|
|
#include <fstream>
|
|
|
|
using namespace std;
|
|
|
|
int main() {
|
|
cout << "Advent of Code 2021 - Day 1 Part 1" << endl;
|
|
|
|
ifstream filein("input");
|
|
string line;
|
|
getline(filein, line);
|
|
|
|
int last = stoi(line);
|
|
int count = 0;
|
|
|
|
for (line; getline(filein, line); )
|
|
{
|
|
if(stoi(line) > last) {
|
|
count++;
|
|
}
|
|
|
|
last = stoi(line);
|
|
}
|
|
|
|
cout << count << endl;
|
|
|
|
return 0;
|
|
} |