题解 | #类型转换#
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double d = scanner.nextDouble();
System.out.println(Main.typeConversion(d));//利用函数求解
}
public static int typeConversion(double d){
//write your code here......
int D = (int) d;//强制类型转换
return D;//有返回值的函数
}
}