3.5测试点错,哪位大佬给看看?
查看原帖
3.5测试点错,哪位大佬给看看?
745349
BlueStar_zhjy楼主2022/8/6 11:35

附代码

#include<iostream>
using namespace std;
int main(){
	int s,v;//s路程 v速度 
	cin>>s>>v;
	int t;//t时间 min
	if(s%v==0){
		t=s/v+10;
	}else{
		t=s/v+11;
	}
	int min=480;//8小时对应的分钟 
	int h,m;//h所需时间的小时,m分钟 
	if(t>min){
		t=t-min;
		h=t/60;
		m=t-h*60;
		if(h>15){
			cout<<"0"<<24-h-1<<":"<<60-m;	
		}else{
			cout<<24-h-1<<":"<<60-m;
		}
	}else{
		h=t/60;
		m=t-h*60;
		cout<<"0"<<8-h-1<<":"<<60-m;
	}
	return 0;
}

2022/8/6 11:35
加载中...