c++蒟蒻求助--样例输出7:50
查看原帖
c++蒟蒻求助--样例输出7:50
585978
_Jarvis_楼主2022/10/17 23:39
#include<bits/stdc++.h>
using namespace std;
int s,h,f;
double t,v;
int main(){
	//freopen("b.in","r",stdin);
	//freopen("b.out","w",stdout);
	cin>>s>>v;
	v=v/60*1.0;
	t=s/v;
	h=t/60;
	f=int(t)%60+10;
	if(h<8){
		if(f>60){
			cout<<0<<8-h<<":"<<120-f;
		}
		else{
			cout<<0<<8-h<<":"<<60-f;
		}
	}
	else{
		if(f>60){
			cout<<32-h<<":"<<120-f;
		}
		else{
			cout<<32-h<<":"<<60-f;
		}
	}
	//fclose(stdin);fclose(stdout);
	return 0;
}

2022/10/17 23:39
加载中...