using System;
public delegate int MathOpertion(int a, int b);
public class HelloWorld
{
public static int Calculate(int x, int y, MathOpertion operation)
{
return operation(x,y);
}
static int Add(int a,int b) => a+b;
static int Multiply(int a,int b)=>a*b;
public static void Main()
{
Console.WriteLine("HELLO world! - cs.jsrun.net ");
int result1 =Calculate(5,4,Add);
int result2 =Calculate(5,4,Multiply);
Console.WriteLine($"加法:{result1}");
Console.WriteLine($"乘法:{result2}");
int result3 = Calculate(5,4,(a,b)=>a-b);
Console.WriteLine($"减法:{result3}");
}
}