int a, b;
Console.WriteLine("请输入1个数字。");
a = Console.Read();
Console.WriteLine("请输入第2个数字。") ;
b = Console.Read();
if (a > 10 && b > 10)
Console.WriteLine("请重输入");
else
Console.Write("{0},{1}", a, b);
int a, b;
Console.WriteLine("请输入1个数字。");
a = Convert.ToInt32(Console.Read());
Console.WriteLine("请输入第2个数字。") ;
b = Convert.ToInt32(Console.Read());
if (a > 10 && b > 10)
Console.WriteLine("请重输入");
else
Console.Write("{0},{1}", a, b);
输入的string ,要转换为int。当然如果输入不能转化为数字,会抛出异常。可以用int.TryParse方法转换。
你的ab不一定是整型吧