题解 | #取近似值#
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
import java.util.Scanner;
import java.math.*;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while (input.hasNext()) {
float A1 = input.nextFloat();
if (A1 <= 0) {
System.out.print(0);
} else {
int x = Math.round(A1);
System.out.print(x);
}
}
}
}