Jeeff @ 2024-09-03 13:26:43
骑车有50秒的时间在干别的事,于是走路就多走了50*1.2=60米 骑车每秒追回来1.8米,那就要33秒,再乘3米就是100米,用计算器核查结果发现时间一样,很好!用三目直接搞定七行!
by mc_xiexie @ 2024-09-03 13:40:41
@Drifts
那么代价是什么呢?
评论区tj建议紫衫
by hanxiaofensheng @ 2024-09-03 14:15:37
#include<iostream>
using namespace std;
int x, a, b;
int main(){
scanf("%d",&x);
a=x/1.2;
b=x/3+50;
if(a<b) cout<<"Walk";
else if(a==b) cout<<"All";
else cout<<"Bike";
}
《非要用三目么》。。。。。。
by Jeeff @ 2024-09-03 19:39:07
@xiaokeai1234 我真是太喜欢用三目,将三行浓缩为一行,非常的“节约”!
by Jeeff @ 2024-09-03 19:42:28
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a;
cin>>a;
cout<<(a<100?"Walk":(a==100?"All":"Bike"));
}
by hanxiaofensheng @ 2024-09-03 19:46:26
@Drifts dalao真厉害
by Jeeff @ 2024-09-06 13:38:19
@hanxiaofensheng 谢谢,我不算~
by liyunxiao_ycy @ 2024-11-28 12:55:47
@Jeeff 俺也一样:)