parent
bd48599f12
commit
0dae5e5646
@ -0,0 +1,28 @@
|
||||
package jjcc;
|
||||
import java.sql.*;
|
||||
public class jjcc {
|
||||
//addition函数实现的是两个数x和y的加法运算
|
||||
public void addition(double x,double y) {
|
||||
double result;
|
||||
result=x+y;
|
||||
System.out.println(x+"+"+y+"="+result);
|
||||
}
|
||||
//subtraction函数实现的是两个数x和y的减法运算
|
||||
public void subtraction(double x,double y) {
|
||||
double result;
|
||||
result=x-y;
|
||||
System.out.println(x+"-"+y+"="+result);
|
||||
}
|
||||
//multiplication函数实现的是两个数x和y的乘法运算
|
||||
public void multiplication(double x,double y) {
|
||||
double result;
|
||||
result=x*y;
|
||||
System.out.println(x+"*"+y+"="+result);
|
||||
}
|
||||
//division函数实现的是两个数x和y的除法运算
|
||||
public void division(double x,double y) {
|
||||
double result;
|
||||
result=x/y;
|
||||
System.out.println(x+"/"+y+"="+result);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue