flag = 0
for a in range(1,1000):
for b in range(a+1,1000):
if a*a + b*b == (1000-a-b)**2:
print(a,b)
flag = 1
break
if flag == 1:
break print(a*b*(1000-a-b))

Problem 9: Special Pythagorean triplet的更多相关文章

  1. projecteuler Problem 9 Special Pythagorean triplet

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

  2. (Problem 9)Special Pythagorean triplet

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

  3. Special Pythagorean triplet

    这个比较简单,慢慢进入状态. A Pythagorean triplet is a set of three natural numbers, a b c, for which, a2 + b2 = ...

  4. projecteuler----&gt;problem=9----Special Pythagorean triplet

    title: A Pythagorean triplet is a set of three natural numbers, a b c, for which, a2 + b2 = c2 For e ...

  5. Project Euler Problem 9-Special Pythagorean triplet

    我是俩循环暴力 看了看给的文档,英语并不好,有点懵,所以找了个中文的博客看了看:勾股数组学习小记.里面有两个学习链接和例题. import math def calc(): for i in rang ...

  6. Python练习题 037:Project Euler 009:毕达哥拉斯三元组之乘积

    本题来自 Project Euler 第9题:https://projecteuler.net/problem=9 # Project Euler: Problem 9: Special Pythag ...

  7. Project Euler Problem9

    Special Pythagorean triplet Problem 9 A Pythagorean triplet is a set of three natural numbers, a  b  ...

  8. PE 001~010

    题意: 001(Multiples of 3 and 5):对小于1000的被3或5整除的数字求和. 002(Even Fibonacci numbers):斐波那契数列中小于等于4 000 000的 ...

  9. PE刷题记

    PE 中文翻译 最喜欢做这种很有意思的数学题了虽然数学很垃圾 但是这个网站的提交方式好鬼畜啊qwq 1.Multiples of 3 and 5 直接枚举 2.Even Fibonacci numbe ...

随机推荐

  1. Job for docker.service failed because the control process exited with error

    Docker 无法启动 报错信息:Job for docker.service failed because the control process exited with error 找了很久才解决 ...

  2. div变成输入框

    <style> #test{ width: 150px;; min-height:20px; max-height:70px; outline: 0; border: 1px solid ...

  3. C++_day7_继承

    #include <iostream> using namespace std; class Human{ public: Human(string const& name, in ...

  4. [Linux]安装node.js

    node.js安装 安装node.js的版本控制工具nvm curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/ins ...

  5. f-stack nginx多进程报错 primary worker process failed to initialize

    EAL: Detected 4 lcore(s)EAL: Detected 1 NUMA nodesEAL: Multi-process socket /var/run/dpdk/rte/mp_soc ...

  6. C语言实验一(1)

    #include<stdio.h>int main(){ int a,b,sum; a=123; b=456; sum=a+b; printf("sum is %d\n" ...

  7. servlet两种配置方法详解

     1.web.xml中Servlet的注解 <servlet> <!-- servlet的内部名称,自定义 --> <servlet-name>DemoAction ...

  8. 爬虫(五)requests模块2

    引入 有些时候,我们在使用爬虫程序去爬取一些用户相关信息的数据(爬取张三“人人网”个人主页数据)时,如果使用之前requests模块常规操作时,往往达不到我们想要的目的,例如: #!/usr/bin/ ...

  9. 【剑指Offer学习】【所有面试题汇总】

    剑指Offer学习 剑指Offer这本书已经学习完了,从中也学习到了不少的东西,现在做一个总的目录,供自已和大家一起参考,学如逆水行舟,不进则退.只有不断地学习才能跟上时候,跟得上技术的潮流! 所有代 ...

  10. 略解TCP乱序和丢包

    在使用基于TCP实现的各种组件的时候,我们经常会处理数据包.这数据包说来奇怪,从来不会丢失,也不会乱序,只会产生粘包.底层的机制是如何实现的呢?进来我们就来用简洁易懂的文字描述清楚. 在TCP数据包设 ...