master
691798 4 years ago
parent 35e0891009
commit dc660dc0c4

@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package calculator;
import java.util.*;
public class sj {
public sj() {
Scanner inScanner=new Scanner(System.in);
System.out.print("请输入一个运算(单位为度):");
int a=inScanner.nextInt();
System.out.print("接下来摁1是sin函数2是cos函数3是tan函数");
int y=inScanner.nextInt();
if(y==1){
double x = Math.toRadians(a);
System.out.println(Math.sin(x));
}
if(y==2) {
double b = Math.toRadians(a);
System.out.println(Math.cos(b));
}
if(y==3){
double c = Math.toRadians(a);
System.out.println(Math.tan(c));
}
}
}
Loading…
Cancel
Save