90分,蒟蒻求助
查看原帖
90分,蒟蒻求助
716861
Wuhhhhhh楼主2022/4/29 21:51
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
	int s, v;
	cin >> s >> v;
	int t = ceil(1.0 * s / v);
	if (470 >= t)
	{
		if ((470 - t) / 60 <= 10)	printf("0%d", (470 - t) / 60);
		else cout << (470 - t) / 60;
		cout << ':';
		if ((470 - t) % 60 <= 10)	printf("0%d", (470 - t) % 60);
		else cout << (470 - t) % 60;
	}
	else
	{
		int ti = t - 470;
		if ((1440 - ti) / 60 <= 10)	printf("0%d", (1440 - ti) / 60);
		else cout << (1440 - ti) / 60;
		cout << ':';
		if ((1440 - ti) % 60 <= 10)	printf("0%d", (1440 - ti) % 60);
		else cout << (1440 - ti) % 60;
	}
	return 0;
}
2022/4/29 21:51
加载中...