image

1 条评论

  • @ 2023-8-4 19:22:16

    上学迟到???

    #include <iostream>
    #include <cstdio>
    #include <cmath>
    using namespace std;
    double s,v;
    int t,h,m;
    int main()
    {
        cin >> s >> v;
        t = ceil(s/v)+10;//ceil函数是向上取整,在cmath库里
        h = (1920-t)/60;
        m = (1920-t)%60;
        if(h>=24) h-=24;
        if(h<10)printf("0%d:%d",h,m);
        else printf("%d:%d",h,m);
        return 0; 
    }
    
  • 1