清华校园出行方式选择:骑车还是步行?
#include <iostream>
using namespace std;
int main() {
int distance;
cin >> distance;
int bikeTime = 27 + distance / 3;
int walkTime = distance / 1.2;
if (bikeTime < walkTime) {
cout << "Bike" << endl;
} else if (bikeTime > walkTime) {
cout << "Walk" << endl;
} else {
cout << "All" << endl;
}
return 0;
}
原文地址: http://www.cveoy.top/t/topic/h99A 著作权归作者所有。请勿转载和采集!