using System;
namespace testCounting
{
public class Counting
{
public static void Main(string[] args)
{
int counter,copy,sum;
counter = 0;
int[] digits = new int[5];
for(int number=10000;number<100000;number++)
{
copy = number;
for(int j=4;j>=0;j--)
{
digits[j] = copy%10;
copy = copy /10;
}
sum = 0;
for(int j = 0;j < 5;j++)
sum += digits[j];
if(sum == 22)
counter++;
}
Console.WriteLine("{0}",counter);
Console.ReadKey();
}
}
}
dXNpbmcgU3lzdGVtOwpuYW1lc3BhY2UgdGVzdENvdW50aW5nCnsKCXB1YmxpYyBjbGFzcyBDb3VudGluZwoJewoJCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKHN0cmluZ1tdIGFyZ3MpCgkJewoJCQlpbnQgY291bnRlcixjb3B5LHN1bTsKCQkJY291bnRlciA9IDA7CgkJCWludFtdIGRpZ2l0cyA9IG5ldyBpbnRbNV07CgkJCWZvcihpbnQgbnVtYmVyPTEwMDAwO251bWJlcjwxMDAwMDA7bnVtYmVyKyspCgkJCXsKCQkJCWNvcHkgPSBudW1iZXI7CgkJCQlmb3IoaW50IGo9NDtqPj0wO2otLSkKCQkJCXsKCQkJCQlkaWdpdHNbal0gPSBjb3B5JTEwOwoJCQkJCWNvcHkgPSBjb3B5IC8xMDsKCQkJCX0KCQkJCXN1bSA9IDA7CgkJCQlmb3IoaW50IGogPSAwO2ogPCA1O2orKykKCQkJCQlzdW0gKz0gZGlnaXRzW2pdOwoJCQkJaWYoc3VtID09IDIyKQoJCQkJCWNvdW50ZXIrKzsKCQkJfQoJCQlDb25zb2xlLldyaXRlTGluZSgiezB9Iixjb3VudGVyKTsKCQkJQ29uc29sZS5SZWFkS2V5KCk7CgkJfQoJfQp9