public static String Chuoi(PHAN_SO ps) { String kq; kq = ps.Tu_so + "/" + ps.Mau_so; return(kq); }
public static String Chuoi(PHAN_SO M) { String kq; kq = M.Tu_so + "/" + M.Mau_so; return(kq); }
public static String Chuoi_phan_so(PHAN_SO Ps) { String kq; kq = Ps.Tu_so + "/" + Ps.Mau_so; return(kq); }
public static PHAN_SO Tich(PHAN_SO M, PHAN_SO N) { PHAN_SO kq; kq.Tu_so = M.Tu_so * N.Tu_so; kq.Mau_so = M.Mau_so * N.Mau_so; return(kq); }
public static PHAN_SO Hieu_phan_so(PHAN_SO M, PHAN_SO N) { PHAN_SO kq; kq.Tu_so = M.Tu_so * N.Mau_so - N.Tu_so * M.Mau_so; kq.Mau_so = M.Mau_so * N.Mau_so; return(kq); }
public static String Chuoi(ArrayList Ps) { String kq = ""; for (int i = 0; i < Ps.Count; i++) { PHAN_SO x = (PHAN_SO)Ps[i]; kq = kq + XL_PHAN_SO.Chuoi(x); if (i < Ps.Count - 1) { kq = kq + Ky_tu_phan_cach; } } return(kq); }
public static String Chuoi_day_phan_so(ArrayList Ps) { String kq = ""; for (int i = 0; i < Ps.Count; i++) { PHAN_SO x = (PHAN_SO)Ps[i]; kq = kq + Chuoi_phan_so(x); if (i < Ps.Count - 1) { kq = kq + ","; } } return(kq); }
public static QUAN_HE So_sanh(PHAN_SO M, PHAN_SO N) { QUAN_HE kq = QUAN_HE.Nho_hon; long D; D = M.Tu_so * N.Mau_so - M.Mau_so * N.Tu_so; if (D < 0) { kq = QUAN_HE.Nho_hon; } else if (D == 0) { kq = QUAN_HE.Bang_nhau; } else if (D > 0) { kq = QUAN_HE.Lon_hon; } return(kq); }