From e57f58f67d2e5fb82e6436b3d9ebddbefc69fb8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9A=AE=E5=85=89=E9=AA=91=E5=A3=AB=E6=9C=88=E7=85=8CTUT?= <1779600184@qq.com> Date: Thu, 6 Aug 2020 21:27:14 +0800 Subject: [PATCH 1/5] xjq --- 代码/duishu.java | 9 +++++++ 代码/main.java | 58 +++++++++++++++++++++++++++++++++++++++++ 代码/sanjiao.java | 16 ++++++++++++ 代码/sizeyunsuan.java | 32 +++++++++++++++++++++++ 代码/zhishu.java | 11 ++++++++ 5 files changed, 126 insertions(+) create mode 100644 代码/duishu.java create mode 100644 代码/main.java create mode 100644 代码/sanjiao.java create mode 100644 代码/sizeyunsuan.java create mode 100644 代码/zhishu.java diff --git a/代码/duishu.java b/代码/duishu.java new file mode 100644 index 0000000..ac29411 --- /dev/null +++ b/代码/duishu.java @@ -0,0 +1,9 @@ +package open; + +public class duishu { + + public double duishu(double a,double b) { + return Math.log(a)/Math.log(a); + } + +} diff --git a/代码/main.java b/代码/main.java new file mode 100644 index 0000000..7a476e8 --- /dev/null +++ b/代码/main.java @@ -0,0 +1,58 @@ +package open; +import java.util.Scanner; +public class main { + + public main() { + + } + + public static void main(String[] args) { + double a,c; String b; + Scanner sc = new Scanner(System.in); + a=sc.nextDouble(); + b=sc.next(); + if(b.equals("sin")) { + sanjiao d=new sanjiao(); + System.out.println(d.sanjiao("sin", a)); + } + else if(b.equals("cos")) { + sanjiao d=new sanjiao(); + System.out.println(d.sanjiao("cos", a)); + } + else if(b.equals("tan")) { + sanjiao d=new sanjiao(); + System.out.println(d.sanjiao("tan", a)); + } + else if(b.equals("^")) { + zhishu d=new zhishu(); + System.out.println(d.zhishu(a)); + } + else if(b.equals("log")) { + duishu d=new duishu(); + c=sc.nextDouble(); + System.out.println(d.duishu(a, c)); + } + else if(b.equals("+")) { + sizeyunsuan d=new sizeyunsuan(); + c=sc.nextDouble(); + System.out.println(d.add(a, c)); + } + else if(b.equals("-")) { + sizeyunsuan d=new sizeyunsuan(); + c=sc.nextDouble(); + System.out.println(d.subtract(a, c)); + } + else if(b.equals("*")) { + sizeyunsuan d=new sizeyunsuan(); + c=sc.nextDouble(); + System.out.println(d.multiply(a, c)); + } + else if(b.equals("/")) { + sizeyunsuan d=new sizeyunsuan(); + c=sc.nextDouble(); + System.out.println(d.divide(a, c)); + } + else System.out.println(""); + } + +} diff --git a/代码/sanjiao.java b/代码/sanjiao.java new file mode 100644 index 0000000..dc8ce40 --- /dev/null +++ b/代码/sanjiao.java @@ -0,0 +1,16 @@ +package open; + +public class sanjiao { + +public double sanjiao(String a,double b) { + double c=Math.toRadians(b); + if(a=="sin") + return Math.sin(c); + else if(a=="cos") + return Math.cos(c); + else if(a=="tan") + return Math.tan(c); + return 0; +} + +} diff --git a/代码/sizeyunsuan.java b/代码/sizeyunsuan.java new file mode 100644 index 0000000..97f21c8 --- /dev/null +++ b/代码/sizeyunsuan.java @@ -0,0 +1,32 @@ +package open; + +public class sizeyunsuan { + + public double add(double add1, double add2) { + //ӷ + double result; + result = add1 + add2; + return result; + } + + public double subtract(double sub1, double sub2) { + // + double result; + result = sub1 - sub2; + return result; + } + + public double multiply(double mul1, double mul2) { + //˷ + double result; + result = mul1 * mul2; + return result; + } + + public double divide(double div1, double div2) { + // + double result; + result = div1 / div2; + return result; + } +} diff --git a/代码/zhishu.java b/代码/zhishu.java new file mode 100644 index 0000000..9f6eab6 --- /dev/null +++ b/代码/zhishu.java @@ -0,0 +1,11 @@ +package open; + +public class zhishu { + + public double zhishu(double a) { + return Math.pow(Math.E,a); + + } + + +} From 237ad102fe184db623c993a2faf19bea925c70ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E6=AD=A3=E6=9D=B0?= <786784022@qq.com> Date: Thu, 6 Aug 2020 21:59:36 +0800 Subject: [PATCH 2/5] jie --- diushu.java | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 diushu.java diff --git a/diushu.java b/diushu.java new file mode 100644 index 0000000..2ac319a --- /dev/null +++ b/diushu.java @@ -0,0 +1,9 @@ +package open; + +public class duishu { + + public double duishu(double a,double b) { + return Math.log(a)/Math.log(a); + } + +} \ No newline at end of file From 1b96b75db2ecab2ebd8c2e7300606005b7cc1459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E6=AD=A3=E6=9D=B0?= <786784022@qq.com> Date: Thu, 6 Aug 2020 23:02:27 +0800 Subject: [PATCH 3/5] fuxian --- zhisu.java | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 zhisu.java diff --git a/zhisu.java b/zhisu.java new file mode 100644 index 0000000..990c6ce --- /dev/null +++ b/zhisu.java @@ -0,0 +1,9 @@ +public class zhishu { + + public double zhishu(double a) { + return Math.pow(Math.E,a); + + } + + +} From 62de210ffd3a14ee8c95c29d2d3ee48d2d2802af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E6=AD=A3=E6=9D=B0?= <786784022@qq.com> Date: Thu, 6 Aug 2020 23:05:16 +0800 Subject: [PATCH 4/5] On branch master Your branch is up to date with 'origin/master'. Changes to be committed: deleted: zhisu.java --- zhisu.java | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 zhisu.java diff --git a/zhisu.java b/zhisu.java deleted file mode 100644 index 990c6ce..0000000 --- a/zhisu.java +++ /dev/null @@ -1,9 +0,0 @@ -public class zhishu { - - public double zhishu(double a) { - return Math.pow(Math.E,a); - - } - - -} From 49a5fd3ba0ad3119d0d4ef5e0b6931a2da884a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E6=AD=A3=E6=9D=B0?= <786784022@qq.com> Date: Thu, 6 Aug 2020 23:07:21 +0800 Subject: [PATCH 5/5] zhaofuxian --- zhisu.java | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 zhisu.java diff --git a/zhisu.java b/zhisu.java new file mode 100644 index 0000000..990c6ce --- /dev/null +++ b/zhisu.java @@ -0,0 +1,9 @@ +public class zhishu { + + public double zhishu(double a) { + return Math.pow(Math.E,a); + + } + + +}