解题思路:
注意事项:
参考代码:
#蓝桥杯基础练习VIP-龟兔赛跑预测Python版 v1,v2,t,s,l = map(int,input().strip().split()) x1,x2,time = 0,0,0 while x1 < l and x2 < l: x1 += v1 x2 += v2 time += 1 if (x1-x2) >= t and x1 < l and x2 < l: for i in range(s): x2 += v2 time += 1 if x2 >= l: break if x1 == x2: print('D') elif x1 > x2: print('R') else: print('T') print(time)
0.0分
3 人评分