C++卡3,5求助!!!
查看原帖
C++卡3,5求助!!!
1383564
DDV1楼主2024/7/28 10:09
#include<bits/stdc++.h>
using namespace std;
int main(){
	int s,v,add=480;
	cin>>s>>v;
	int y;
	if(s%v==0)
	y=s/v;
	else
	y=s/v+1;
	y=y+10;
	int H=y/60,M=y%60;
	if(y<=480){
		if(M==0)
		cout<<"0"<<8-H<<":00";
		else
		cout<<"0"<<7-H<<":"<<60-M;
	} 
	if(y>480){
		if(M==0 and 24-(H-8)>=10)
		cout<<24-(H-8)<<":00";
		if(M==0 and 24-(H-8)<10)
		cout<<"0"<<24-(H-8)<<":00";
		if(M!=0 and 24-(H-8+1)>=10)
		cout<<24-(H-8+1)<<":"<<60-M;
		if(M!=0 and (24-(H-8+1)<10))
		cout<<"0"<<24-(H-8+1)<<":"<<60-M;
	}
	return 0;
}

我太难了。。。

2024/7/28 10:09
加载中...