fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;//n为待处理的数据数量
  6. cin >> n;
  7. for (int i = 0; i < n; i++)
  8. {
  9. int m;//每次办事要走的距离
  10. cin >> m;
  11. double b, w;//b为骑车所花费的时间,w为走路所花费的时间
  12. b = m / 3.0 + 50;
  13. w = m / 1.2;
  14. if (b > w)
  15. cout << "Walk" << endl;
  16. else if (b < w)
  17. cout << "Bike" << endl;
  18. else
  19. cout << "All" << endl;
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 4256KB
stdin
4
50
90
120
180
stdout
Walk
Walk
Bike
Bike