C#题编写一个进行加减乘除四则运算的程序,要求;输出2个单精度数,然后输入一个运算符号,输出2个单精度
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("请输入两个数:");
Console.WriteLine("add="+Add.add(Int32.Parse( Console.ReadLine()),Int32.Parse( Console.ReadLine())));
Console.WriteLine("请输入两个数:");
Console.WriteLine("less=" + Less.less(Int32.Parse(Console.ReadLine()), Int32.Parse(Console.ReadLine())));
Console.WriteLine("请输入两个数:");
Console.WriteLine("Multiply="+Multiply.multiply (Int32.Parse( Console.ReadLine()),Int32.Parse( Console.ReadLine())));
Console.WriteLine("请输入两个数:");
Console.WriteLine("Divided="+Divided.divided (Int32.Parse( Console.ReadLine()),Int32.Parse( Console.ReadLine())));
Console.ReadLine();
}
class Add
{
public static int add(int a, int b) { return (a + b); }
}
class Less
{
public static int less(int a, int b) { return (a - b); }
}
class Multiply
{ public static int multiply(int a, int b){return (a * b);}
}class Divided
{
public static int divided(int a, int b){return (a / b);}
}
}
}