My solutions for Advent of Code.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
adventofcode/2019/Day1/Program.cs

28 lines
779 B

using System;
using System.IO;
using System.Collections.Generic;
namespace Day1 {
class Program {
static void Main(string[] args) {
string input = File.ReadAllText(@"./input.txt"); // get the input
string[] inputs = input.Split( Environment.NewLine, StringSplitOptions.None );
int[] modules = new int[inputs.Length];
Part1.Get get1 = new Part1.Get();
modules = get1.FuelModules( inputs ); // get the fuel for the mass'es
Console.WriteLine( get1.FuelSum( modules ) );
List<int[]> modulesOfModules = new List<int[]>();
Part2.Get get2 = new Part2.Get();
modulesOfModules = get2.AllFuelModules( modules );
Console.Write( "Real sum of fuel: " );
Console.Write( get2.RealFuelSum(modulesOfModules) );
Console.Write( "\n" );
}
}
}