CSharp · Console
using System;
public class Program
{
public static void Main()
{
for (int i = 0; i < 100; i++)
{
Console.WriteLine(i + " " + ContainsDigit(i, 3));
}
}
public static bool ContainsDigit(int input, int digit)
{
do
{
if (input % 10 == 3)
{
return true;
}
input /= 10;
}
while (input > 0);
return false;
}
}