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.
|
|
|
|
/*
|
|
|
|
|
* 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("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>㣨<EFBFBD><E3A3A8>λΪ<CEBB>ȣ<EFBFBD>:");
|
|
|
|
|
int a=inScanner.nextInt();
|
|
|
|
|
System.out.print("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>sin<69><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32>cos<6F><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3<EFBFBD><33>tan<61><6E><EFBFBD><EFBFBD>");
|
|
|
|
|
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));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|