Hàm Opp
Hàm Opp
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static double a, b;
static int chon;
static int menu()
{
Console.WriteLine("--------MENU--------");
Console.WriteLine("1.nhap 2 so nguyen");
Console.WriteLine("2.Tinh hieu hai so");
Console.WriteLine("3.thoat");
Console.WriteLine("MOI BAN CHON");
Console.Write("nhap lua chon");
chon = int.Parse(Console.ReadLine());
return chon;
}
chon = menu();
if (chon == 1)
{
nhap(ref a, ref b);
else if (chon == 2)
Console.WriteLine($"Hieu cua {a} va {b} la: {hieu(a, b)}");
else if (chon == 3)
{
Console.WriteLine("Ban chon thoat ? Bam phim bat ky de thoat");
Console.ReadKey();
quit = true;
break;
}
if (quit == true)
break;
Console.ReadKey();
}
}
}
}