???
查看原帖
???
749028
QAQ5楼主2025/1/4 10:50
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double result = (double) scanner.nextInt() / scanner.nextInt();
        if ((int) (result * 10000000000L % 10) > 4)
            result += 0.000000001;
        result = (double) (int) (result * 1000000000) / 1000000000;
        System.out.println(result);
    }
}

就样例和第一题对了

2025/1/4 10:50
加载中...