[Csharp]
Using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Text;
Namespace TestClaclulate
{
Class Program
{
Static void Main (string [] args)
{
// 1. Define the double variable.
Double numberOne;
Double numberTwo;
// 2. obtain two numbers from the console
Try
{
NumberOne = double. Parse (Console. ReadLine ());
NumberTwo = double. Parse (Console. ReadLine ());
// 3. output the result of the addition, subtraction, multiplication, and division of the two numbers.
Console. WriteLine (numberOne + "+" + numberTwo + "=" + (numberOne + numberTwo ));
Console. WriteLine (numberOne + "-" + numberTwo + "=" + (numberOne-numberTwo ));
Console. WriteLine (numberOne + "*" + numberTwo + "=" + (numberOne * numberTwo ));
Console. WriteLine (numberOne + "/" + numberTwo + "=" + (numberOne/numberTwo ));
}
Catch (System. FormatException e)
{
Console. WriteLine (e. Message );
}
//
Console. ReadKey ();
}
}
}
Author: haifengzhilian