C++20分,错在哪,麻烦大佬们看一眼
查看原帖
C++20分,错在哪,麻烦大佬们看一眼
797265
baoyouyang楼主2023/2/6 23:51
#include <bits/stdc++.h>
using namespace std;

int main() {
	int s , v , t , HH , MM , hh;
	cin >> s >> v;
	
	t = ceil(s/v)+10;
	if(t>59){
		hh=floor(t/60); MM=t-floor(t/60)*60;
		if(hh>8){
			HH=32-hh;
		}
		else{
			HH=hh;
		}
	}
	if(t<=59){HH=7; MM=59-t;}
	
	if(HH<12){cout << "0" << HH << ":" << MM;}
	else cout << HH << ":" << MM;
	
	return 0;
}
2023/2/6 23:51
加载中...