? ? ? ? ? ? int a, b, sum;? ? ? ? ? ? Console.WriteLine("請輸入第一個數(shù)字:");? ? ? ? ? ? a = Console.Read();? ? ? ? ? ? Console.WriteLine("請輸入第二個數(shù)字:");? ? ? ? ? ? b = Console.Read();? ? ? ? ? ? sum = a + b;? ? ? ? ? ? Console.WriteLine("兩個數(shù)的和是:" + sum);
1 回答

Cong聰
TA貢獻1條經(jīng)驗 獲得超1個贊
? ? ? ? ? ? ? ? ?int a = 0, b = 0, sum;
? ? ? ? ? ? ? ? Console.WriteLine("請輸入第一個數(shù)字:");
? ? ? ? ? ? ? ? a = Convert.ToInt32(Console.ReadLine());
? ? ? ? ? ? ? ? Console.WriteLine("請輸入第二個數(shù)字:");
? ? ? ? ? ? ? ? b = Convert.ToInt32(Console.ReadLine());
? ? ? ? ? ? ? ? sum = a + b;
? ? ? ? ? ? ? ? Console.WriteLine("兩個數(shù)的和是:" + sum);
輸入后需要換行,才能輸出內(nèi)容
- 1 回答
- 0 關(guān)注
- 1102 瀏覽
添加回答
舉報
0/150
提交
取消