为什么是70分?最后三个测试点没过。求助!!!
查看原帖
为什么是70分?最后三个测试点没过。求助!!!
918208
felix1楼主2024/12/19 19:57

为什么是70分? 最后三个测试点没过。 求助!!!

#include<bits/stdc++.h>
using namespace std;
int s,v,t1,t2,m,h;
int main(){
	cin>>s>>v;
	t1=s/v+10;
	t2=480-t1;
	m=t2%60;
	h=t2/60;	
	if(h<10&&m>=10){
		cout<<"0"<<h<<":"<<m-1;
	}
	else if(h<10&&m<10){
		cout<<"0"<<h<<":"<<"0"<<m-1;
	}
	else{
		cout<<h<<":"<<m-1;
	}
	return 0;
}
2024/12/19 19:57
加载中...