using System;
namespace ConsoleApplication2
{
class SimpleCalculator
{
public static void Main(string[] args)
{
int x;
int y;
int z;
SimpleCalculator kkk = new SimpleCalculator();
Console.Write("Enter first number:");
x = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter second number:");
y = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter thrid number:");
z = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("The sum is:"+ SimpleCalculator.Sum(x,y));
Console.WriteLine("The product is:" +kkk.Product(x,y));
Console.WriteLine("The subtract is :" + Subtract(x,y));
Console.WriteLine("The maximum number is :" + Math.Max(x,y));
Console.WriteLine("The minimum number is :" + Math.Min(x,y));
Console.WriteLine("The minimum number is :" + Math.Min(Math.Min(x,y),z));
}
public static int Sum(int a, int b)//静态方法 在同一类中直接调用
{ //或者 类名加静态方法名
int sumTotal;
sumTotal = a + b;
return sumTotal;
}
public int Product( int a,int b)//非静态方法 创建一个实例加上非静态方法调用
{
int productTotal ;
productTotal = a * b;
return productTotal;
}
public static int Subtract(int a, int b)
{
int SubtractTotal;
SubtractTotal = a - b;
return SubtractTotal;
}
}
}