20分(C++)求助!
查看原帖
20分(C++)求助!
1044048
Algorithm_ZRF楼主2023/8/24 15:57
#include <bits/stdc++.h>
using namespace std;
int s, v, t, h = 7, m = 60;
void read() {
	scanf("%d%d",&s,&v);
}
void compute() {
	t = ceil((double)s / v) ;
	t = 470 - t;
	if (t > 0) {
		h -= ceil(t / 60) - 1;
		m -= t % 60;
	}
	m -= t;
}
void print() {
	if (h < 10) {
		printf("0%d:%d",h,m) ;
	} else {
		printf("%d:%d",h,m);
	}
}
int main() {
	read();
	compute();
	print();
	return 0;
}
2023/8/24 15:57
加载中...