输入三个数a,b,c, 判断能否以它们为三个边长构成直角三角形。若能,输出YES,否则输出NO。‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬
    ‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬
    输入格式‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬
    输入包括三行,每行是一个数字‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬
    输出格式‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬
    ‘YES’ 或’NO’

    解析

    1. 判定三角形:
      1. 边长都大于0
      2. 任意两边之和大于第三边
    2. 判定直角三角形:
      1. 是三角形
      2. 勾股定理判定直角三角形
    3. 可先找出最大值 和最小值 再进行判定

    常见问题

    1. 乱抄!!! ```python if a == 0 and b != 0:

    elif a == 0 and b == 0:

    elif delta < 0:

    elif delta == 0:

    1. 2. 分支下缺少语句块,导致语法错误
    2. ![image.png](https://cdn.nlark.com/yuque/0/2022/png/1157448/1647441385189-e2415fab-2c36-4dee-a09e-bc5f02a0b354.png#clientId=ude746e92-0dc8-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=507&id=uab65e62d&margin=%5Bobject%20Object%5D&name=image.png&originHeight=760&originWidth=1226&originalType=binary&ratio=1&rotation=0&showTitle=false&size=84921&status=done&style=none&taskId=ue22a358b-8370-4382-b8f8-623b8a8b89e&title=&width=817.3333333333334)
    3. ```python
    4. a = eval(input())
    5. b = eval(input())
    6. c = eval(input())
    7. shortest = min(a, b, c)
    8. longest = max(a, b, c)
    9. middle = sum([a, b, c]) - shortest - longest
    10. if shortest <= 0 or shortest + middle <= longest:
    11. elif shortest ** 2 + middle ** 2 == longest ** 2:
    12. print("YES")
    13. else:
    14. print("NO")
    1. 未判定能否构成三角形,若边长为负值时有可能满足勾股定理,但此时不是三角形
      1. a = eval(input())
      2. b = eval(input())
      3. c = eval(input())
      4. ls = [a,b,c]
      5. ls.sort()
      6. if ls[0]**2 + ls[1]**2 == ls[2]**2:
      7. print('YES')
      8. else:
      9. print('NO')
      a = eval(input())
      b = eval(input())
      c = eval(input())
      if a * a + b * b ==c * c or a * a + c * c ==b * b or c * c + b * b ==a * a:
       print('YES')
      else:
       print('NO')