diff --git a/jiajianchengchu.java b/jiajianchengchu.java new file mode 100644 index 0000000..9fe8284 --- /dev/null +++ b/jiajianchengchu.java @@ -0,0 +1,24 @@ +class Jiajianchengchu +{ + public double jia(double c,double b) + + { + return c+b; + } + + public double jian(double b,double t) + + { + return b-t; + } + public double cheng(double y,double u) + { + return y*u; + + } + public double chu(double i,double k) + { + if(k!=0) + return i/k; + } +} diff --git a/main.java b/main.java deleted file mode 100644 index ebe6bfd..0000000 --- a/main.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.company; -import java.util.*; -public class Main { - - public static void main(String[] args) { - - Scanner function= new Scanner(System.in); - String a=function.nextLine(); - if(a.equals("sin")||a.equals("cos")||a.equals("tan")){ - Scanner radian= new Scanner(System.in); - double b=radian.nextDouble(); - } - else{ - Double.parseDouble(a); - Scanner sc= new Scanner(System.in); - String b=sc.nextLine(); - Scanner sc1= new Scanner(System.in); - double c=sc1.nextDouble(); - if(b.equals("^")) - double d=zhishu.zhishu(a,c); - if(b.equals("log")) - double d=fengsj1.duishu(a,c); - if(b.equals("+")) - double d=Jiajianchengchu.jia(a,c); - if(b.equals("-")) - double d=Jiajianchengchu.jian(a,c); - if(b.equals("*")) - double d=Jiajianchengchu.cheng(a,c); - if(b.equals("/")) - double d=Jiajianchengchu.chu(a,c); - System.out.println(d); - } - } -} \ No newline at end of file