package s;
import java.util.Scanner;
public class sin {
public static void main(String[] args) {
// TODO Auto-generated method stub
int X,K;
String print = "" ;
double Y = 0;
String i = null;//switch的表达式
Scanner sc = new Scanner(System.in);
System.out.print("请输入X的值:");
X = sc.nextInt();
System.out.print("请输入K的值:");
K = sc.nextInt();
System.out.print("请输入三角函数:");
i = sc.next();
switch(i)
{
case "sin":
if(X>0 && X<=30) {
Y =(Math.sin(X));
print = "算式一值:"+Y;
}
break;
case "cos":
if(X>30 && X<=60) {
Y = (Math.cos((Math.pow(X, K))));
print = "算式二值:"+Y;
}
break;
case "tan":
if(X>60) {
Y = (Math.tan(X/K));
print = "算式三值:"+Y;
}
break;
default:
print = "输入不符合要求!";
break;
}
System.out.print(print);
}
}