using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication4
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string strNumber = "";//存儲(chǔ)的用戶的輸入
? ? ? ? ? ? do
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.WriteLine("請輸入數(shù)字");
? ? ? ? ? ? ? ? strNumber = Console.ReadLine();//數(shù)字? q? ? 亂七八糟
? ? ? ? ? ? ? ? if (strNumber != "q")//數(shù)字? 亂七八糟
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? try
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? int number = Convert.ToInt32(strNumber);
? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("這個(gè)數(shù)字的2倍是{0}", number * 2);
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? catch//輸入的是亂七八糟
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("輸入有誤朦促,請重新輸入");
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else//==q
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Console.WriteLine("你輸入的是q,程序退出N依蕖4倜唷!");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? } while (strNumber != "q");
? ? ? ? ? ? Console.ReadKey();
? ? ? ? }
? ? }
}