using System;
namespace _2021___Day_01
{
class Program
{
static void Main()
{
int counter = 0;
string line;
int[] fileBuffer = new int[2000];
// Read the file and display it line by line.
System.IO.StreamReader file =
new System.IO.StreamReader(@"../../../../Input.in");
while ((line = file.ReadLine()) != null)
{
fileBuffer[counter] = int.Parse(line);
counter++;
}
file.Close();
counter = 0;
for (int i = 1; i < fileBuffer.Length; i++)
{
if (fileBuffer[i] > fileBuffer[i-1])
{
Console.WriteLine(fileBuffer[i].ToString() + " is bigger than " + fileBuffer[i - 1]);
counter++;
}
}
Console.WriteLine("There are " + counter.ToString() + " increments");
counter = 0;
for (int i = 3; i < fileBuffer.Length; i++)
{
if (fileBuffer[i] + fileBuffer[i - 1] + fileBuffer[i - 2] > fileBuffer[i - 1] + fileBuffer[i - 2] + fileBuffer[i - 3])
{
counter++;
}
}
Console.WriteLine("There are " + counter.ToString() + " three-sum window increments");
}
}
}