标签: java
如何使用float变量只显示2个小数点?我也使用Scanner
float num; System.out.println("Enter any number"); num = user_input.nextFloat(); System.out.println("Square of " + num + " is: "+Math.pow(num, 2));