using System;
namespace Task8
{
class Program
{
static void Main(string[] args)
{
int a, b, ab, summ;
Console.Write("Введите двухзначное число - ");
ab = Int32.Parse(Console.ReadLine());
if (ab >= 10 && ab<=99)
{
b = ab % 10;
a = (ab - b)/10;
summ = a + b;
Console.WriteLine("Сумма цифр числа - {0} ", summ);
Console.ReadKey();
}
else
{
Console.WriteLine("Ошибка");
Console.ReadKey();
}
}
}
}
dXNpbmcgU3lzdGVtOwoKbmFtZXNwYWNlIFRhc2s4CnsKICAgIGNsYXNzIFByb2dyYW0KICAgIHsKICAgICAgICBzdGF0aWMgdm9pZCBNYWluKHN0cmluZ1tdIGFyZ3MpCiAgICAgICAgewogICAgICAgICAgICBpbnQgYSwgYiwgYWIsIHN1bW07CiAgICAgICAgICAgIENvbnNvbGUuV3JpdGUoItCS0LLQtdC00LjRgtC1INC00LLRg9GF0LfQvdCw0YfQvdC+0LUg0YfQuNGB0LvQviAtICIpOwogICAgICAgICAgICBhYiA9IEludDMyLlBhcnNlKENvbnNvbGUuUmVhZExpbmUoKSk7CiAgICAgICAgICAgIGlmIChhYiA+PSAxMCAmJiBhYjw9OTkpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGIgPSBhYiAlIDEwOwogICAgICAgICAgICAgICAgYSA9IChhYiAtIGIpLzEwOwogICAgICAgICAgICAgICAgc3VtbSA9IGEgKyBiOwogICAgICAgICAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoItCh0YPQvNC80LAg0YbQuNGE0YAg0YfQuNGB0LvQsCAtIHswfSAiLCBzdW1tKTsKICAgICAgICAgICAgICAgIENvbnNvbGUuUmVhZEtleSgpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoItCe0YjQuNCx0LrQsCIpOwogICAgICAgICAgICAgICAgQ29uc29sZS5SZWFkS2V5KCk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0=