沈荔 2023-02-08 22:06 采纳率: 87.5%
浏览 32

在python中的for循环中输出不来任何东西

为什么又是输出不出来任何东西呢


x = int(input())
count = 0
X = [int(i) for i in input().split()]
Y = [int(j) for j in input().split()]
R = [int(k) for k in input().split()]
point = [int(l) for l in input().split()]
x1 = (point[0] + point[2])/2
y1 = (point[1] + point[3])/2
r1 = ((point[0]-point[2])**2 + (point[1] - point[3])**2)**0.5
r11 = r1/2
for h in range(x):
    #每个圆点到已知圆的距离
    print(type(X[h]))
    if ((X[h] - x1) ** 2 + (Y[h] - y1) ** 2) ** 0.5 < r11:
        if (((X[h] - x1) ** 2 + (Y[h] - y1) ** 2) ** 0.5 + R[h]) ==r11:
            count += 1
        else:
            count+= 0
    elif ((X[h] - x1) ** 2 + (Y[h] - y1) ** 2) ** 0.5 > r11:
        if ((X[h] - x1) ** 2 + (Y[h] - y1) ** 2) ** 0.5<(r11 +R[h]):
            count += 2
        elif ((X[h] - x1) ** 2 + (Y[h] - y1) ** 2) ** 0.5 == (r11+R[h]):
            count += 1
        elif ((X[h] - x1) ** 2 + (Y[h] - y1) ** 2) ** 0.5 >(r11 + R[h]):
            count+= 0
    else:
        count+=0
print(count)

img

  • 写回答

3条回答 默认 最新

  • GISer Liu 2023-02-08 22:51
    关注

    以下答案引用自GPT-3大模型,请合理使用:
    输出结果为:

    4

    评论

报告相同问题?

问题事件

  • 修改了问题 2月8日
  • 创建了问题 2月8日

悬赏问题

  • ¥66 关于川崎机器人调速问题
  • ¥15 winFrom界面无法打开
  • ¥15 crossover21 ARM64版本安装软件问题
  • ¥15 mymetaobjecthandler没有进入
  • ¥15 mmo能不能做客户端怪物
  • ¥15 osm下载到arcgis出错
  • ¥15 Dell g15 每次打开eiq portal后3分钟内自动退出
  • ¥200 使用python编写程序,采用socket方式获取网页实时刷新的数据,能定时print()出来就行。
  • ¥15 matlab如何根据图片中的公式绘制e和v的曲线图
  • ¥15 我想用Python(Django)+Vue搭建一个用户登录界面,但是在运行npm run serve时报错了如何解决?