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.
59 lines
1.3 KiB
59 lines
1.3 KiB
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("´íÎó");
|
|
}
|
|
|
|
}
|