using System.Collections.Generic;
using System.Threading.Tasks;
public class SinhVien : IComparable
public SinhVien(string MS, string HT, double DTB, string Khoa )
Console.WriteLine("nhap mSSV: ");
this.MSSV1= Console.ReadLine();
Console.WriteLine("nhap Ho Ten: ");
this.HoTen = Console.ReadLine();
Console.WriteLine("nhap diem: ");
this.DiemTB1 = double.Parse(Console.ReadLine());
Console.WriteLine("nhap Khoa: ");
this.Khoa = Console.ReadLine();
Console.WriteLine("MSSV:" + this.MSSV1);
Console.WriteLine("Ho ten :"+ this.HoTen);
Console.WriteLine("diem Trung binh:" + this.DiemTB1.ToString());
Console.WriteLine("khoa:" + this.Khoa);
public int CompareTo(object obj)
SinhVien s1 = (SinhVien)obj;
double tb1 = this.DiemTB;
return tb1 > tb2 ? 1 : (tb1 < tb2 ? -1 : 0);
public override string ToString()
string msg = string.Format("mssv: {0},\n hoten: {1},\n diem: {2},\n khoa: {3},\n ",
this.MSSV, this.hoTen, this.DiemTB, this.khoa);