lagt till ny egenkonstruerad sekvens

This commit is contained in:
2018-12-26 01:14:30 +01:00
parent 418997dce7
commit 422616b14d
3 changed files with 14 additions and 8 deletions

View File

@ -35,6 +35,8 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using static System.Console;
namespace _2018_08
@ -12,14 +7,21 @@ namespace _2018_08
{
static void Main(string[] args)
{
string[] resTab = File.ReadAllText(@"..\..\..\Data\Adventofcode_181208\2018_08_data.txt").Split(' ');
//string[] resTab = File.ReadAllText(@"..\..\..\Data\Adventofcode_181208\2018_08_data.txt").Split(' ');
//string[] resTab = @"2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2 2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2".Split(' ');
string[] resTab = @"2 3 2 1 2 3 1 1 0 2 1 2 3 0 3 4 5 6 7 8 9 0 4 10 11 12 13 14 2 2 0 3 15 16 17 0 2 18 19 20 21 22 23 24".Split(' ');
int[] numbers = new int[resTab.Length];
for (int i = 0; i < resTab.Length; i++)
{
numbers[i] = int.Parse(resTab[i]);
}
WriteLine($"Antal värden = {resTab.Length}");
int y = 0;
for(int z = 1; z < 25; z++)
{
y += z;
}
WriteLine($"Antal värden = {resTab.Length} svar = {y}");
ReadKey();
var pgm = new Program();