Dogplay @ 2023-11-06 16:42:24
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
double a,b;
scanf("%d",&n);
a=n/1.2;
b=n/3+50.0;
if(a>b)
printf("Bike");
else if(b>a)
printf("Walk");
else
printf("All");
return 0;
}
哪里有问题帮忙指出 小狗非常感谢!汪汪汪
by I_like_you @ 2023-11-06 16:54:33
把b=n/3+50.0改成b=n/3.0+50.0
by Dogplay @ 2023-11-06 16:55:14
?!
6
太6了
谢谢
by wht_1218 @ 2023-11-06 17:18:46
虽说我来晚了
这里是整除:
如果是整数除以整数,结果就会向下取整,所以必须改成浮点(*1.0)
by 2013wjy @ 2023-11-09 20:39:15
我来晚了