class Program
{
static void Main()
{
var a1 = ReadInt32("A1=");
var d = ReadInt32("d=");
var n = ReadInt32("n=");
var oddCount = GetOddCount(a1, d, n);
Console.WriteLine("Odd number count=" + oddCount);
Console.ReadLine();
}
static int GetOddCount(int a1, int d, int n)
{
var i = 0;
var result = 0;
for (var a = a1; i < n; i++, a = a + d)
if (a%2 != 0)
result++;
return result;
}
static int ReadInt32(string prompt)
{
while (true)
{
Console.Write(prompt);
var str = Console.ReadLine();
int result;
if (Int32.TryParse(str, out result))
return result;
Console.WriteLine("Не число, еще раз");
}
}
}