求救

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

ZTR6666 @ 2024-04-06 11:00:38

求救


by BobPang @ 2024-04-06 11:04:47

wyy紫衫请


by iamsh @ 2024-04-06 11:10:52

请给出评测记录或者错误的代码


by __Tonycyt__ @ 2024-04-06 11:12:03

@BobPang 这不是无意义,他没法代码而已


by ycy1124 @ 2024-04-06 11:12:12

@ZTR6666

你好像都没有提交过这道题


by xhl_leo @ 2024-04-10 14:31:02


#include<bits/stdc++.h>
using namespace std;
int main(){
    double s,v,m;
    int n,a,t,b;
    cin>>s>>v;
    n=8*60+24*60;
    t=ceil(s/v)+10;
    n=n-t;
    if(n>=24*60) n-=24*60;
    b=n%60;
    a=n/60;
    if(a<10){
        if(b<10) cout<<"0"<<a<<":0"<<b;
        else cout<<"0"<<a<<":"<<b;
    }
    else{
        if(b<10) cout<<a<<":0"<<b;
        else cout<<a<<":"<<b;
    }
    return 0;
}

by yinlu_offical @ 2024-04-10 20:17:14

这个方法感觉不错

#include<bits/stdc++.h>
using namespace std;
int main()
{
    double s,v;
    scanf("%lf%lf",&s,&v);
    double t1=ceil(s/v);
    int h=7,m=50;
    m-=t1;
    while(m<0)
    {
        h--;
        if(h<0)
          h+=24;
        m+=60;
    }
    if(h<10)
      printf("0%d",h);
    else
      printf("%d",h);
    printf(":");
    if(m<10)
      printf("0%d",m);
    else
      printf("%d",m);
    return 0;
}

|