c++8,9,10测试点过不了,求助大佬看看代码哪里错了
查看原帖
c++8,9,10测试点过不了,求助大佬看看代码哪里错了
1217077
AME2014楼主2023/12/4 16:44
#include<iostream>
using namespace std;
int main(){
	int s,v;
	cin>>s>>v;
	int t,t1;
	t=s/v;
	if(t*v<s)
		t=t+1;
	t1=t+10;
	if(t1>=24*60)
		t1=t1-24*60;
	int h=t1/60;
	int m=t1%60;
	int b=60-m;
	if(b>=10&&b<60)
		cout<<"0"<<(7-h)<<":"<<b;
	else
		cout<<"0"<<(7-h)<<":"<<"0"<<b;
	if(m==0)
		cout<<"0"<<(8-h)<<":"<<"00";
	system("pause");
	return 0;
}
2023/12/4 16:44
加载中...