class Program
{
static void Main(string[] args)
{
string questFormat = "How much is {0} times {1}?";
string rightStr = "Very good! Excel lent! Nice work! Keep up the good work!";
string[] wrongStr = new string[] { "No, Please try again.", "Wrong, Try once more.", "Don’t give up!", "No, Keep trying." };
Random random = new Random();
while (true)
{
int a = random.Next(0, 10);
int b = random.Next(0, 10);
int c = 0;
while (true)
{
Console.WriteLine(questFormat, a, b);
if (int.TryParse(Console.ReadLine(), out c))
{
if (c == a * b)
{
Console.WriteLine(rightStr);
break;
}
}
Console.WriteLine(wrongStr[random.Next(0, 4)]);
}
}
}
}