我是俩循环暴力
看了看给的文档,英语并不好,有点懵,所以找了个中文的博客看了看:勾股数组学习小记。里面有两个学习链接和例题。

import mathdef calc():for i in range(1,1000):j = i+1while j <= 1000:c = i*i+j*jc = int(math.sqrt(c))if i+j+c > 1000:breakif i < j < c and i+j+c == 1000 and i*i+j*j == c*c:return i,j,cj += 1return 0,0,0a,b,c = calc()
print a,b,c
print a*b*c

转载于:https://www.cnblogs.com/guoyongheng/p/7572067.html

Project Euler Problem 9-Special Pythagorean triplet相关推荐

  1. Project Euler Problem 104 Pandigital Fibonacci ends

    Pandigital Fibonacci ends Problem 104 The Fibonacci sequence is defined by the recurrence relation: ...

  2. Project Euler Problem 66

    Problem 66 Consider quadratic Diophantine equations of the form: x2 – Dy2 = 1 For example, when D=13 ...

  3. Project Euler Problem 27小结

    Project Euler上有很多有意思的问题,刚做到第27题,对这个问题做个小结. Problem 27: Euler有一个著名的方程n^2+n+41,当n=0到39时,方程结果均为质数.如今人们用 ...

  4. Project Euler Problem 27 Quadratic primes

    Quadratic primes Problem 27 Euler discovered the remarkable quadratic formula: n2+n+41 It turns out ...

  5. Project Euler Problem 92 Square digit chains

    Square digit chains Problem 92 A number chain is created by continuously adding the square of the di ...

  6. Project Euler Problem 25 1000-digit Fibonacci number

    1000-digit Fibonacci number Problem 25 The Fibonacci sequence is defined by the recurrence relation: ...

  7. Project Euler Problem 14 Longest Collatz sequence

    Longest Collatz sequence Problem 14 The following iterative sequence is defined for the set of posit ...

  8. Project Euler Problem 48: Self powers

    Self powers Problem 48 The series, 11 + 22 + 33 + ... + 1010 = 10405071317. Find the last ten digits ...

  9. Project Euler Problem 53: Combinatoric selections【组合数】

    PE其他解题报告请参考这里,本题答案在留言首条 Combinatoric selections Problem 53 There are exactly ten ways of selecting t ...

最新文章

  1. 通过Navicat for MySQL远程连接的时候报错mysql 1130的解决方法
  2. Handler消息传递机制
  3. cobbler 无人值守-安装
  4. 腾讯首个AI开源项目完成3.0版本迭代,从顶级开源基金会毕业
  5. Elasticsearch原理与调优
  6. spring 控制hibernate的session何时关闭.
  7. Android蓝牙4.0的数据通讯
  8. 如何形容自己的计算机水平,信息在计算机中的表示
  9. php感悟1500,《苏菲的世界》读书笔记及心得感悟1500字
  10. commons-logging中无法寻找log4j
  11. python之HTML文件转PDF文件,python之把HTML文件转换成PDF格式文档
  12. 下载我的CSDN资源
  13. 【OS笔记 9】操作系统内核的功能
  14. HDU - 5651 xiaoxin juju needs help 逆元模板
  15. 随机采样和分布式光线追踪
  16. Unity客户端开发面试题记录
  17. 错误(mailed 59 bytes of output but got status 0x004b#012)
  18. u-boot 详细介绍
  19. R语言中的线性判别分析
  20. Oracle EBS专业术语与名词解释

热门文章

  1. 神经网络和深度学习-第二周神经网络基础-第四节:梯度下降法
  2. MyBatis-Oracle-selectKey返回主键
  3. SCM-SVN集成服务器
  4. windows 加域
  5. Exadata上oracle binary的make日志
  6. linux中的umask 函数
  7. ASP.NET文件下载
  8. 基于遗传算法实现自动组卷
  9. MYSQL 实时升级
  10. Coil - Google推荐的协程图片加载库