You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
857 B
37 lines
857 B
package test;
|
|
import java.sql.*;
|
|
import java.util.Scanner;
|
|
public class jjcc {
|
|
static double x,y;
|
|
Scanner in=new Scanner(System.in);
|
|
x=in..nextDouble();
|
|
y=in..nextDouble();
|
|
//addition函数实现的是两个数x和y的加法运算
|
|
public void addition() {
|
|
double result;
|
|
result=x+y;
|
|
System.out.println(x+"+"+y+"="+result);
|
|
}
|
|
//subtraction函数实现的是两个数x和y的减法运算
|
|
public void subtraction() {
|
|
double result;
|
|
result=x-y;
|
|
System.out.println(x+"-"+y+"="+result);
|
|
}
|
|
//multiplication函数实现的是两个数x和y的乘法运算
|
|
public void multiplication() {
|
|
double result;
|
|
result=x*y;
|
|
System.out.println(x+"*"+y+"="+result);
|
|
}
|
|
//division函数实现的是两个数x和y的除法运算
|
|
public void division() {
|
|
double result;
|
|
result=x/y;
|
|
System.out.println(x+"/"+y+"="+result);
|
|
}
|
|
public static void main(String[] args) {
|
|
}
|
|
}
|
|
}
|