import os #数据已改 (-170,-1000),(0,700),(40,940), (300, 2500),(550,7500) def calnum (x1, y1, x2, y2, t):     return int( ((y2-y1)/(x2-x1)) * (t - x1) + y1 ) t =100 x1 , x2 = 0, 0 y1 , y2 = 0, 0      while (True):     t = int( input())     if t < -400:         print("-400")     if t > 1000:         print("1000")     if t < -170:         x1 = -170         y1 = -1000         x2 = 0         y2 = 700         print(calnum(x1, y1, x2, y2, t))     elif t < 0:         x1 = -170         y1 = -1000         x2 = 0         y2 = 700         print(calnum(x1, y1, x2, y2, t))     elif t < 40:         x1 = 0         y1 = 700         x2 = 40         y2 = 940         print(calnum(x1, y1, x2, y2, t))     elif t < 300:         x1 = 40         y1 = 940         x2 = 300         y2 = 2500         print(calnum(x1, y1, x2, y2, t))     elif t < 550:         x1 = 300         y1 = 2500         x2 = 550         y2 = 7500         print(calnum(x1, y1, x2, y2, t))     else:         x1 = 300         y1 = 2500         x2 = 550         y2 = 7500         print(calnum(x1, y1, x2, y2, t))     
点赞 评论

相关推荐

湫湫湫不会java:写的很杂,连自己都不知道找什么工作的感觉,只是要份工作。针对自己稍微有点优势的方向好好整份简历投投吧,然后这杂的简历就辅助投投,因为自己认为的优势可能也不是很大的优势all in可能失业,自己也没有啥很想的方向还是可以用这通用的碰碰运气吧,加油
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务