85分求助,有三个测试点没通过
查看原帖
85分求助,有三个测试点没通过
477520
GT龙居楼主2021/3/2 13:58
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        double a = scan.nextDouble();
        double i ;
        double w = 0;
        double s = 100000;
        for (i = 1;i<=3;i++){
            int n = scan.nextInt();
            int m = scan.nextInt();
            w = Math.ceil(a/n)*m;
            if(w<s){
                s=w;
            }
        }
        System.out.println((int)s);
    }
}
2021/3/2 13:58
加载中...