コード例 #1
0
    public static Boolean Kiem_tra(String Chuoi)
    {
        Boolean kq = true;

        try
        {
            String[] Chuoi_dong = Chuoi.Split(new char[] { Ky_tu_phan_cach_dong });
            int      So_dong    = Chuoi_dong.Length;
            int      So_cot     = Chuoi_dong[0].Split(new char[] { Ky_tu_phan_cach_cot }).Length;
            for (int i = 0; i < So_dong; i++)
            {
                String[] Dong = Chuoi_dong[i].Split(new char[] { ',' });
                for (int j = 0; j < So_cot; j++)
                {
                    if (!XL_SO_THUC.Kiem_tra(Dong[j]))
                    {
                        kq = false;
                        break;
                    }
                }
                if (!kq)
                {
                    break;
                }
            }
        }
        catch (Exception Loi)
        {
            kq = false;
        }
        return(kq);
    }
コード例 #2
0
    public static DON_THUC Nhap()
    {
        DON_THUC kq;

        kq.He_so = XL_SO_THUC.Nhap("Nhap he so: ");
        kq.So_mu = XL_SO_NGUYEN.Nhap("Nhap so mu: ");
        return(kq);
    }
コード例 #3
0
    public static DIEM Nhap(String Ghi_chu)
    {
        DIEM kq;

        XL_CHUOI.Xuat(Ghi_chu);
        kq.x = XL_SO_THUC.Nhap("Hoanh do:");
        kq.y = XL_SO_THUC.Nhap("Tung do:");
        return(kq);
    }
コード例 #4
0
    public static DON_THUC Nhap(String Ghi_chu)
    {
        DON_THUC kq;

        XL_CHUOI.Xuat(Ghi_chu);
        kq.He_so = XL_SO_THUC.Nhap("He so = ");
        kq.So_mu = XL_SO_NGUYEN.Nhap("So mu = ");
        return(kq);
    }
コード例 #5
0
 public static PHUONG_TRINH_DUONG_THANG Nhap(String Ghi_chu)
 {
     PHUONG_TRINH_DUONG_THANG kq;
     XL_CHUOI.Xuat(Ghi_chu);
     kq.a = XL_SO_THUC.Nhap("Nhap a:");
     kq.b = XL_SO_THUC.Nhap("Nhap b:");
     kq.c = XL_SO_THUC.Nhap("Nhap c:");        
     return kq;
 }
コード例 #6
0
    public static NHI_THUC Nhap(String Ghi_chu)
    {
        NHI_THUC kq;

        XL_CHUOI.Xuat(Ghi_chu);
        kq.a = XL_SO_THUC.Nhap("Nhap a : ");
        kq.b = XL_SO_THUC.Nhap("Nhap b : ");
        return(kq);
    }
コード例 #7
0
    public static DUONG_TRON Nhap(String Ghi_chu)
    {
        DUONG_TRON kq;

        XL_CHUOI.Xuat(Ghi_chu);
        kq.I = XL_DIEM.Nhap("Toa do tam I cua duong tron:\n");
        kq.R = XL_SO_THUC.Nhap("Nhap R:");
        return(kq);
    }
コード例 #8
0
    public static TAM_THUC Nhap(String Ghi_chu)
    {
        TAM_THUC kq;

        XL_CHUOI.Xuat(Ghi_chu);
        kq.a = XL_SO_THUC.Nhap("a=");
        kq.b = XL_SO_THUC.Nhap("b=");
        kq.c = XL_SO_THUC.Nhap("c=");
        return(kq);
    }
コード例 #9
0
    static void Main(string[] args)
    {
        ArrayList P;
        Double    x0;
        Double    kq;

        P  = XL_DA_THUC.Nhap("Nhap da thuc P(x):\n");
        x0 = XL_SO_THUC.Nhap("Nhap x0 = ");
        kq = XL_DA_THUC.Tinh_gia_tri(P, x0);
        String Chuoi;

        Chuoi = "Gia tri da thuc P(x)=" + XL_DA_THUC.Chuoi(P) + "\n";
        Chuoi = Chuoi + "voi x0=" + x0 + " la :" + kq;
        XL_CHUOI.Xuat(Chuoi);
    }
コード例 #10
0
    public static void Main()
    {
        Double a;
        Double b;
        Double c;

        a = XL_SO_THUC.Nhap("Canh goc vuong thu 1:");
        b = XL_SO_THUC.Nhap("Canh goc vuong thu 2:");
        c = Math.Sqrt(a * a + b * b);
        String Chuoi;

        Chuoi = "Tam giac voi 2 canh goc vuong la a=" + a;
        Chuoi = Chuoi + " va b=" + b;
        Chuoi = Chuoi + " co chieu dai canh huyen la c=" + c;
        XL_CHUOI.Xuat(Chuoi);
    }
コード例 #11
0
    public static void Main(string[] args)
    {
        DON_THUC P;
        Double   x0;

        Double kq;

        P  = XL_DON_THUC.Nhap("Nhap don thuc:\n");
        x0 = XL_SO_THUC.Nhap("Gia tri x0 = ");
        kq = XL_DON_THUC.Tinh_gia_tri(P, x0);
        String Chuoi = "Gia tri cua don thuc P(x)=";

        Chuoi = Chuoi + XL_DON_THUC.Chuoi(P) + "\n";
        Chuoi = Chuoi + "voi x0=" + x0;
        Chuoi = Chuoi + " la " + kq;
        XL_CHUOI.Xuat(Chuoi);
    }
コード例 #12
0
    public static Boolean Kiem_tra(String Chuoi)
    {
        Boolean kq = true;

        try
        {
            String[] M = Chuoi.Split(new char[] { Ky_tu_phan_cach });
            for (int i = 0; i < M.Length; i++)
            {
                if (!XL_SO_THUC.Kiem_tra(M[i]))
                {
                    kq = false;
                    break;
                }
            }
        }
        catch (Exception Loi)
        {
            kq = false;
        }
        return(kq);
    }