#include<iostream>
using namespace std;
int main() {
int H = 8;
unsigned long long s, v, t = 0;
cin >> s >> v;
if (s % v) {
t = s / v + 1 + 10;
}
else t += 10;
if (t - 60 < 0) {
--H; t = 60 - t;
}
while (t - 60 > 0) {
--H;
t -= 60;
if (H <= 0)H += 24;
}
if (H < 10) {
if (t < 10)cout << "0" << H << ":" << "0" << t;
else cout << "0" << H << ":" << t;
}
else {
if (t < 10)cout << H << ":" << "0" << t;
else cout << H << ":" << t;
}
return 0;
}
是超时没谁了。。哈哈,然后他没反应,,
100 100
E:\vs2019--代码\试一下知识\Debug\试一下知识.exe (进程 20800)已退出,代码为 -1073741510。
要在调试停止时自动关闭控制台,请启用“工具”->“选项”->“调试”->“调试停止时自动关闭控制台”。
按任意键关闭此窗口. . .
2____________----------------------------------------------------60---答案当然是错的
#include<iostream>
using namespace std;
int main() {
int m = 0, t = 0, s = 0, x = 0;
cin >> m >> s >> t;
if (t == 0) { cout << 0; return 0; }
else {
if (m * t >= s) { cout << 0; return 0; }
else {
if (s % t) {
x = s / t + 1;
cout << m - x;
return 0;
}
else {
x = s / t;
cout << m - x;
return 0;
}
}
return 0;
}