Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SliceFiles
- {
- using System.Collections.Generic;
- using System.Linq;
- class Program
- {
- static void Main(string[] args)
- {
- List<int> results=new List<int>();
- for (int i = 1; i <7; i++)
- {
- for (int j = 1; j <7; j++)
- {
- for (int k = 1; k <7; k++)
- {
- int currentroll = i + j + k;
- results.Add(currentroll);
- }
- }
- }
- int totalPermutations = results.Count;
- int resultForNine = results.Count(x => x == 9);
- int resultForTen = results.Count(x => x== 10);
- Console.WriteLine("Ten is presented in {0}, Nine is presented in {1}, total permutations are {2}"
- ,resultForTen,resultForNine,totalPermutations);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment