From 73e81364160fc019ae93b7de1b3ea27184c861f8 Mon Sep 17 00:00:00 2001 From: Dongboo <291832125@qq.com> Date: Fri, 7 Aug 2020 20:41:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E5=90=88=E6=89=80=E6=9C=89=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=EF=BC=8C=E5=B9=B6=E6=B5=8B=E8=AF=95=E4=BA=86?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Main.java | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Main.java diff --git a/Main.java b/Main.java new file mode 100644 index 0000000..6b155b9 --- /dev/null +++ b/Main.java @@ -0,0 +1,38 @@ +package test; + +import java.util.Scanner; + +public class Main { + static double a,b; + public static double add (double a,double b) {//加法 + return a+b; + } + public static double sub (double a,double b) {//减法 + return a-b; + } + + public static double mult(double a,double b) {//乘 + return a*b; + } + public static double div(double a,double b) {//除 + return a/b; + } + + public static double power(double a,double b) {//幂 + return Math.pow(a,b); + } + public static double sqrt(double a) {//开方 + return Math.sqrt(a); + } + + public static double log(double a) { + return Math.log(a); + } + + public static void main(String[] args) { + Scanner sc = new Scanner( System.in ); + a=sc.nextInt(); + b=sc.nextInt(); + System.out.println(add(a,b)+" "+sub(a,b)+" "+mult(a,b)+" "+div(a,b)+" "+power(a,b)+" "+sqrt(a)+" "+log(a)); + } +}