Tags: Arithmetic Operators //算术运算符
Given two integers N1 and N2, divide the former by the latter and store the result in R.
给定两个整数 N1 和 N2,将前者除以后者并将结果存储在 R 中。
(结果保留两位小数)
Input
50
5
Output
10.00
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
float N1=s.nextFloat();
float N2=s.nextFloat();
float R;
R=N1/N2;
System.out.printf("%.2f",R);
}
输出结果: