wa了第四个检测点。read 5 expected 4.o(╥﹏╥)o
思路做题:
要得到“ 完整的苹果 数量 ”
完整的苹果数量,I.如果吃完的时候,计时器没结束。则 剩余 “ 完整的苹果数量 ”0。
II.如果计时器结束,没吃完。
① 则“完整的苹果数量”为 m(总数)- v(速度) * s(时间);
② 因为存在小数部分, “ 完整的苹果数量 ”实际是.0 printf出来的。
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
double numbers;
int main() {
double m = 0, t = 0, s = 0;
cin >> m >> t >> s;
double realTime = m * t;
if (realTime < s) {
printf("0");
} else {
double v = 1 / t;
numbers = m - v * s;
printf("%.0lf", numbers);
}
return 0;
}