c++8,9,10测试点过不了,求助大佬看看代码哪里错了

P5707 【深基2.例12】上学迟到

AME2014 @ 2023-12-04 16:44:28

#include<iostream>
using namespace std;
int main(){
    int s,v;
    cin>>s>>v;
    int t,t1;
    t=s/v;
    if(t*v<s)
        t=t+1;
    t1=t+10;
    if(t1>=24*60)
        t1=t1-24*60;
    int h=t1/60;
    int m=t1%60;
    int b=60-m;
    if(b>=10&&b<60)
        cout<<"0"<<(7-h)<<":"<<b;
    else
        cout<<"0"<<(7-h)<<":"<<"0"<<b;
    if(m==0)
        cout<<"0"<<(8-h)<<":"<<"00";
    system("pause");
    return 0;
}

by lym12 @ 2023-12-04 17:10:22

system("pause");

删掉。


by lym12 @ 2023-12-04 17:11:01

等等不是这个的问题欸


by lym12 @ 2023-12-04 17:11:17

我不懂


|