我需要輸出值d
使用相同的Console.WriteLine
。但我只得到結果不是輸出中d
的值。我能以何種方式實現這一目標?使用控制檯writeline c#
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int a;
int b;
Console.WriteLine("Please Enter the first Digit");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Please Enter the Second Digit");
b = Convert.ToInt32(Console.ReadLine());
int d = a + b;
Console.WriteLine("Result",(d));
}
}
}
+1打我給它 – Manatherin 2012-08-14 10:04:32
爲什麼括號? – Adam 2012-08-14 10:05:41
沒有必要,但從OP的問題中複製它們。 – Maarten 2012-08-14 10:06:03