using System; using System.IO; namespace _2021___Day_06 { class Program { static void Main(string[] args) { //int days = 80; int days = 256; int maxAge = 8; var sr = new StreamReader(@"../../../../Input.in"); long[] age = new long[maxAge + 1]; string line = sr.ReadLine(); var numArray = line.Split(','); foreach (string num in numArray) { int i = int.Parse(num); age[i]++; } for (int i = 0; i < days; i++) { long ageTmp = age[0]; for (int j = 1; j <= maxAge; j++) { age[j - 1] = age[j]; age[j] = 0; } age[8] += ageTmp; age[6] += ageTmp; } long fishCount = 0; for (int j = 0; j <= maxAge; j++) { fishCount += age[j]; } Console.WriteLine("WOAH, " + fishCount.ToString() + " FISH!!"); } } }