50分求助大佬

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

sth080525 @ 2023-08-30 00:05:59

include<bits/stdc++.h>

using namespace std; int main(){ int s,v,min=0,hour=0; cin>>s>>v; if(s%v==0){ min=s/v; } else{ min=(s-s%v)/v+1; } while(min>=60){ hour+=1; min-=60; } hour=7-hour; min=50-min; if(hour>=0) printf("%02d:%02d",hour,min); }


by Miyamizu_Mitsuha @ 2023-08-30 00:08:25

西凤展使md


by Miyamizu_Mitsuha @ 2023-08-30 00:10:55

include<bits/stdc++.h>

using namespace std; 

int main(){ 
  int s,v,min=0,hour=0; 
  cin>>s>>v; 
  if(s%v==0){ 
    min=s/v; 
  } else{ 
    min=(s-s%v)/v+1; 
  } 
  while(min>=60){ 
    hour+=1; 
    min-=60; 
  } 
  hour=7-hour; 
  min=50-min; 
  if(hour>=0)printf("%02d:%02d",hour,min);   
}

by Miyamizu_Mitsuha @ 2023-08-30 00:11:22

提供一下更好的观感


|