public class Calculator { public int evaluate(String expression) { //填写的代码 }}
1 回答
qq_瞳昕_0
TA贡献10条经验 获得超0个赞
//一些基础的语法,没那么楼上那么惊艳
public static void main(String[] args) { System.out.println(add(1, 3)); System.out.println(del(1,3)); System.out.println(chengyi(1, 3)); System.out.println(chuyi(36, 3)); } public static int add(int a,int b) { int c; c = a + b; return c; } public static int del(int a,int b) { int c; c = a - b; return c; } public static int chengyi(int a,int b) { int c; c = a * b; return c; } public static int chuyi(int a,int b) { int c; c = a / b; return c; }
添加回答
举报
0/150
提交
取消