大佬们求纠错,为什么我试了数据是对的
查看原帖
大佬们求纠错,为什么我试了数据是对的
1817750
lijiaming666楼主2025/8/2 09:39
#include<iostream>
#include<cmath>
using namespace std;
int  main() {
	int sumtime;
	int s, v;
	cin >> s >> v;
	sumtime = ceil(s / v + 10);
	int h = sumtime / 60;
	int m = sumtime % 60;
	int t1 = 7 - h;
	int t2 = 59 - m;
	if (t1 < 0) {
		t1 += 24;
	}
	if (t1 < 10) {
		if (t2 < 10) {
			cout << '0' << t1 << ":0" << t2;
		}
		else cout << '0' << t1 << ":" << t2;
	}
	else {
		if (t2 < 10) {
			cout << t1 << ":0" << t2;
		}
		else cout << t1 << ":" << t2;
	}

	return 0;
}
2025/8/2 09:39
加载中...