using System.Collections.Generic;
public static void Main()
Console.WriteLine("Enter expression");
string str = Console.ReadLine();
List <string> list = new List<string>();
for (int i = 0; i < str.Length; i++)
List<string> lTemp = new List<string>();
for (int x = 0; x < list.Count; x++)
for (int j = 2; j <= Convert.ToInt32(str[i].ToString()); j++)
lTemp.Add(temp + j.ToString());
list.Add(str[i].ToString());
for (int j = 0; j < list.Count; j++)
list[j] = list[j] + str[i].ToString();
SortedList<int, int> listResults = new SortedList<int, int>();
foreach (string item in list)
var result = Convert.ToInt32(new DataTable().Compute(item, null));
if(listResults.ContainsKey(result))
listResults.Add(result, 1);
foreach(var item in listResults)
Console.WriteLine("- "+item.Key+" "+Math.Round(((double)item.Value / (double)list.Count), 2)+"%");