public static void Main() {
foreach (var x in from ef in Enumerable.Range(10, 99)
from cd in Enumerable.Range(10, 99)
where new int[]{ef, gh, ab, cd}.SelectMany(o => new int[]{ o / 10, o % 10}).Distinct().Where(o => o != 1).Count() == 8 && ab > 9 && ab < 100
select new {AB = ab, CD = cd, EF= ef, GH = gh}){
Console.WriteLine(string.Format("{0} - {1} = {2} + {3} = 111", x.AB, x.CD, x.EF, x.GH));