//recursion
//input: 123
//output: 3 :)
static int CountDigits(int num, int count)
{
if (num == 0)
{
return count;
}
return CountDigits(num / 10, ++count);
}
static void Main(string[] args)
{
Console.WriteLine(CountDigits(123, 0));
}