3,5,9,10数据点未过求助!!!
查看原帖
3,5,9,10数据点未过求助!!!
1056418
Eric1012楼主2024/1/19 22:24
#include <bits/stdc++.h>
using namespace std;
int main(){
    int s,v,t=10;
    cin>>s>>v;
    if(v==0) cout<<"07:50";
    else{
        if(s%v==0) t=t+s/v;
        else t=t+s/v+1;
        int ts,tf;
        ts=t/60;
        tf=t-60*ts;
        if(ts<8){
            if(tf>50){
                cout<<"0"<<7-ts<<":0"<<tf;
            }
            else{
                cout<<"0"<<7-ts<<":"<<60-tf;
            }
        }
        else if(ts>=8 and ts<=14){
            ts=ts-8;
            if(tf>50){
                cout<<23-ts<<":0"<<tf;
            }
            else{
                cout<<23-ts<<":"<<60-tf;
            }
        }
        else{
            ts=ts-14;
            if(tf>50){
                cout<<9-ts<<":0"<<tf;
            }
            else{
                cout<<9-ts<<":"<<60-tf;
            }
        }
    }
}

到底怎么才能搞才能让这段代码不是这么发啊烦死了整这么久都不会把它用代码块输出

2024/1/19 22:24
加载中...