求大佬看下代码,为啥第七个点过不了。。
查看原帖
求大佬看下代码,为啥第七个点过不了。。
511558
xuanlv楼主2021/6/25 23:29
#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	int s,v;
	cin>>s>>v;
	int res;
	if(s==0){
	cout<<"07:50"<<endl;
	return 0;
	}
	
	if(s%v==0)res=s/v;
	else res=s/v+1;
	
	int max=1430;
	max-=res;
	
	int hour=max/60;
	int min=max%60;
	
	hour+=8;
	 
	if(hour<10||hour>24){
		if(hour>24)hour-=24;
		if(min<10)cout<<0<<hour<<":"<<0<<min<<endl;
		else cout<<0<<hour<<":"<<min<<endl;
	}
	else if(min<10)cout<<hour<<":"<<0<<min<<endl;
	else cout<<hour<<":"<<min<<endl;
	
	return 0;
}
2021/6/25 23:29
加载中...