70,有啥问题?

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

Bennett_LBH @ 2024-11-09 00:43:02

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

by fangkai123 @ 2024-11-09 07:43:55

#include<bits/stdc++.h>
using namespace std;
int  main()
{
    double s,v,t;
    cin>>s>>v;
    t=ceil(s/v)+10;
    int h=ceil(t/60);
    int m=(int)t%60;

    printf("%.02d:%.02d",(8-h+24)%24,(0-m+60)%60);
    return 0;
}

|