日期:2014-05-18 浏览次数:21013 次
#region Using directives using System; using System.Collections.Generic; using System.Linq; using System.Text; #endregion namespace Ch03Ex01 { class Program { static void Main(string[] args) { double firstNumber, secondNumber; string userName; Console.WriteLine("Enter your name:"); userName = Console.ReadLine(); Console.WriteLine("Welcome {0}!", userName); Console.WriteLine("Now give me a number:"); firstNumber = Console.ToDouble(Console.ReadLine()); Console.WriteLine("Now give me another number:"); secondNumber = Console.ToDouble(Console.ReadLine()); Console.WriteLine("The sum of{0} and{1} is {2}.", firstNumber, secondNumber, firstNumber + secondNumber); Console.WriteLine("The result of subtracting{0}from {1} is {2}.", firstNumber, secondNumber, firstNumber - secondNumber); Console.WriteLine("The prdouct of{0} and{1} is {2}.", firstNumber, secondNumber, firstNumber * secondNumber); Console.WriteLine("The remainder after dividing {0} by {1} is {2}.", firstNumber, secondNumber, firstNumber % secondNumber); Console.ReadKey(); } } }