using System; using System.Linq; using System.Collections.Generic; namespace strong_number { class Program { static void Main() { //Sum Adjacent Equal Numbers // 3 3 4 = 6 4 // 3 3 6 4 = 6 6 4 = 12 4 List list = Console.ReadLine().Split(' ').Select(double.Parse).ToList(); int occured = 0; while (true) { for (int i=0; i< list.Count; i++) if (i + 1 < list.Count) { if (list[i] == list[i + 1]) { list[i] += list[i + 1]; list.RemoveAt(i + 1); break; } else { occured++; if (occured== list.Count - 1) { goto print; } } } occured = 0; } print: Console.WriteLine(string.Join(" ", list)); } } }