- double -> int
package test;
import java.util.Scanner;
public class Test1java {
public static void main(String[] args) {
// TODO Auto-generated method stub
double foot; //5
double inch; //7
Scanner in = new Scanner(System.in);
foot = in.nextInt();
inch = in.nextDouble();
//print 170cm
System.out.println((int)((foot+inch/12)*0.3048*100)+"cm");
}
}
* 优先级与c语言基本相同