コード例 #1
0
 public void SilverWorks()
 {
     Assert.Equal(71L, Day18.EvaluateSimple("1 + 2 * 3 + 4 * 5 + 6"));
     Assert.Equal(51L, Day18.EvaluateSimple("1 + (2 * 3) + (4 * (5 + 6))"));
     Assert.Equal(26L, Day18.EvaluateSimple("2 * 3 + (4 * 5)"));
     Assert.Equal(437L, Day18.EvaluateSimple("5 + (8 * 3 + 9 + 3 * 4 * 3)"));
     Assert.Equal(12240L, Day18.EvaluateSimple("5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4))"));
     Assert.Equal(13632L, Day18.EvaluateSimple("((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2"));
 }