some programs!!

This commit is contained in:
rogerwang2008 committed 2026-09-28 14:05:06 +08:00
1 parent ed054247d5
commit 71f1022dea
38 files changed
+1037 -281

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
#include <iostream>
double get_bike_time(double distance) {
return 27 + 23 + distance / 3;
}
double get_walk_time(double distance) {
return distance * 5 / 6;
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int distance;
std::cin >> distance;
while (std::cin >> distance) {
double diff = get_bike_time(distance) - get_walk_time(distance);
if (diff < 1e-8 && diff > -1e-8) {
std::cout << "All" << std::endl;
} else if (diff < 0) {
std::cout << "Bike" << std::endl;
} else {
std::cout << "Walk" << std::endl;
}
}
return 0;
}