예제 #1
0
파일: Program.cs 프로젝트: Gcrouzet/CDA
        static void Main(string[] args)
        {
            Expression exp1      = new Addition(new Nombre(33), new Addition(new Nombre(33), new Nombre(11)));
            int        resultat1 = exp1.Evalue();

            Expression exp2      = new Soustraction(new Nombre(33), new Nombre(33));
            int        resultat2 = exp2.Evalue();


            Expression exp3      = new Addition(new Nombre(7), new Soustraction(new Nombre(3), new Nombre(6)));
            int        resultat3 = exp3.Evalue();

            exp3.Formate();
        }
예제 #2
0
파일: Program.cs 프로젝트: Whyuki/CDA_2005
        static void Main(string[] args)
        {
            Expression expNb       = new Nombre(33);
            int        resultatNb  = expNb.Evalue();
            string     strResultNb = expNb.Formate();

            Expression exp1       = new Addition(new Nombre(33), new Nombre(33));
            int        resultat1  = exp1.Evalue();
            string     strResult1 = exp1.Formate();

            Expression exp2       = new Addition(new Nombre(33), new Addition(new Nombre(33), new Nombre(11)));
            int        resultat2  = exp2.Evalue();
            string     strResult2 = exp2.Formate();

            Expression exp3       = new Soustraction(new Nombre(3), new Nombre(6));
            int        resultat3  = exp3.Evalue();
            string     strResult3 = exp3.Formate();

            Expression exp4       = new Addition(new Soustraction(new Nombre(3), new Nombre(6)), new Nombre(7));
            int        resultat4  = exp4.Evalue();
            string     strResult4 = exp4.Formate();

            Expression exp5       = new Soustraction(new Nombre(3), new Addition(new Nombre(6), new Nombre(7)));
            int        resultat5  = exp5.Evalue();
            string     strResult5 = exp5.Formate();

            Expression exp6       = new Soustraction(new Addition(new Nombre(6), new Nombre(7)), new Nombre(3));
            int        resultat6  = exp6.Evalue();
            string     strResult6 = exp6.Formate();

            Expression exp7       = new Soustraction(new Soustraction(new Nombre(3), new Nombre(9)), new Nombre(6));
            int        resultat7  = exp7.Evalue();
            string     strResult7 = exp7.Formate();

            Expression exp8 = new Soustraction(new Soustraction(new Soustraction(new Nombre(65), new Nombre(13)),
                                                                new Soustraction(new Nombre(3), new Nombre(6))), new Soustraction(new Nombre(74), new Nombre(22)));
            int    resultat8  = exp8.Evalue();
            string strResult8 = exp8.Formate();
        }