只有70分,what!

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

renzhanwen @ 2024-06-09 17:04:54

70分代码如下,希望高手来指点下!


#include<bits/stdc++.h>
using namespace std;
int s,v,k=10;
int main()
{
    cin>>s>>v;
    if(s%v==0)
        k+=s/v;
    else
        k+=s/v+1;
    cout<<"0"<<8-k/60-1<<":";
    k%=60;
    if(60-k<10)
        cout<<"0";
    cout<<60-k;
    return 0;
}

by run_away @ 2024-06-09 17:07:39

@syex_renzhanwen 它有可能在前一天


by renzhanwen @ 2024-06-09 17:09:56

@run_away 那咋改???


by run_away @ 2024-06-09 17:12:22

@syex_renzhanwen 先加一个 24\times60,然后判一下答案是否大于 24\times60


by renzhanwen @ 2024-06-09 17:18:00

@run_away OK


by renzhanwen @ 2024-06-09 17:20:17

此帖结!!!


|