import java.util.Scanner; public class Main { static Scanner scan = new Scanner(System.in); public static void main(String[] args) { while ( scan.hasNextInt() ) { double x; x = scan.nextDouble(); x *= Math.PI / 180; System.out.printf("%.3f",Math.sin( x )); } } }
运行截图: