#编码
string str_num="";
do
{
Console.WriteLine("输入数字");
str_num=Console .ReadLine();
if(str_num=="q")
{
Console .WriteLine ("程序退出");
}
else
{
try
{
int num=Convert.ToInt32(str_num);
Console.WriteLine("两倍是{0}",num*2);
}
catch
{
Console .WriteLine ("输入有误");
}
}
}
while (str_num!="q");
Console.ReadKey();