div.java

来自「在Java中实现数字的加、减、乘、除等运算。」· Java 代码 · 共 42 行

JAVA
42
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package calculatrice;/** * * @author Loïc */public class Div {        public void operer(Pile p){         int val1=0;         int val2=0;     if((p.estvide()==false)&&(val1!=0)){          val1=p.depiler();          val2=p.depiler();         p.empiler(val2/val1);        }    }     public String afficher(){        return "+";    }    public static void main(String args[]){    /*test de la methode operer*/            Pile p=new Pile(3);        Div pl=new Div();        int res;        p.empiler(1);        p.empiler(2);        pl.operer(p);        res=p.depiler();        System.out.println(res);}    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?