第9个测试点大佬求助
查看原帖
第9个测试点大佬求助
675580
N_cows_have_N_d楼主2022/2/4 15:08
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc  =new Scanner(System.in);
        int s = sc.nextInt(), v = sc.nextInt();
        int t = s / v  + 10;
        int h = 0, m;
        if(t >= 60){
            h = t / 60;
            m = t - 60 * (t / 60);
        }else{
            m = t;
        }
        m = 59 - m;
        if(h < 8){
            h = 7 - h;
            if(m >= 10){
                System.out.println("0" + h + ":" + m);
            }else{
                System.out.println("0" + h + ":" + "0" + m);
            }
        }else{
            h = 24 - (h - 7);
            if(m >= 10){
                if(h >= 10){
                    System.out.println(h + ":" + m);
                }else{
                    System.out.println("0"+ h + ":" + m);
                }

            }else{
                if(h >= 10){
                    System.out.println(h + ":" + "0" + m);
                }else{
                    System.out.println("0"+ h + ":" + "0" + m);
                }
            }
        }
    }
}

2022/2/4 15:08
加载中...