上学迟到
查看原帖
上学迟到
1152693
liumangxing楼主2023/11/1 12:45

不知道为啥总有两个是错的

大佬给看看

#include <bits/stdc++.h>
using namespace std;
int main(){
   int s ,v,n=0,h=0,m=0,t;
   cin>>s>>v;
   n=8*60-10;
   t=s*1.0000/v;
   n-=t;
   if(t>24*60){
   	n-=24*60;
   }
   h=n/60;
   m=n%60;
   if(h<10){
   	cout<<0;
   }
   
   cout<<h<<":";
   if(m<10) cout<<0;
   cout<<m-1;
   return 0;
}
2023/11/1 12:45
加载中...