package Hello.lrx.nb;
import java.util.Scanner;
public class shenggao {
public static void main(String[] args) {
double foot;
double inch;
Scanner in = new Scanner(System.in);
foot = in.nextDouble();
inch = in.nextDouble();
System.out.println("foot="+foot+",inch="+inch);
System.out.println("身高为 "+((foot+inch/12)*0.3048*100)+"cm");
System.out.println("身高约为 "+(int)((foot+inch/12)*0.3048*100)+"cm");
}
}
身高转换(Java中的强制类型转换)
最新推荐文章于 2024-08-19 16:01:20 发布