(Problem 9)Special Pythagorean triplet
来源:互联网 发布:淘宝代销什么产品好 编辑:程序博客网 时间:2024/06/07 19:59
A Pythagorean triplet is a set of three natural numbers, a b c, for which,
a2 + b2 = c2
For example, 32 + 42 = 9 + 16 = 25 = 52.
There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc.
#include<stdio.h>#include<math.h>#include<string.h>#include<ctype.h>#include<stdlib.h>#include<stdbool.h>void show(){int a,b,c;for(a=1; a<333; a++){for(c=333; c<500; c++){b=1000-a-c;if(a*a+b*b==c*c){printf("%d\n",a*b*c);return;}}}}int main(){show();return 0;}
Answer:
31875000- (Problem 9)Special Pythagorean triplet
- Problem 9:Special Pythagorean triplet
- Problem 9:Special Pythagorean triplet
- Problem 9 Special Pythagorean triplet (毕达哥拉斯三元数组...)
- 【Project Euler】【Problem 9】Special Pythagorean triplet
- projecteuler---->problem=9----Special Pythagorean triplet
- Project Euler: Problem 9 Special Pythagorean triplet
- Project Euler Problem 9: Special Pythagorean triplet
- PE 9 Special Pythagorean triplet
- 欧拉计划(9)Special Pythagorean triplet
- 9 Special Pythagorean triplet - Project Euler
- project euler 9 Special Pythagorean triplet
- Project Euler 009 Special Pythagorean triplet
- 欧拉项目第九题 Special Pythagorean triplet
- Problem 9 of Pythagorean
- One special sort problem
- Codeforces Problem 707C Pythagorean Triples(数学)
- Codeforces Round #368 (Div. 2) problem: (C) Pythagorean Triples
- iOS中的模糊效果
- 【性能优化案例】执行计划宁可走全表扫描,也不走索引
- TortoiseSVN 中文版安装问题详解
- UVa 311 - Packets
- 静态链接
- (Problem 9)Special Pythagorean triplet
- IE(IE6/IE7/IE8)支持HTML5标签
- android 基础知识三
- #error 等其他常用预处理命令
- ThinkPHP import 方法
- Hibernate 错误集合
- Amdahl's Law
- Java NIO系列教程(三) Buffer
- java入门学习(九) 算术运算符