Find Pythagorean triplet for which a + b + c = 1000

后端 未结 16 2665
离开以前
离开以前 2020-12-24 13:13

A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a2 + b2 = c2

For example, 32 + 4

16条回答
  •  心在旅途
    2020-12-24 13:41

    I'm afraid ^ doesn't do what you think it does in C. Your best bet is to use a*a for integer squares.

提交回复
热议问题