摘要: A Pythagorean triplet is a set of three natural numbers, a b c, for which,a2 + b2 = c2For example, 32 + 42 = 9 + 16 = 25 = 52.There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc.//通项公式//a=M^2-N^2 //b=2MN//c=M^2+N^2 //(M,N为正整数)int main(){ int a,b,c; ... 阅读全文
posted @ 2012-03-29 10:18 AndyDHG 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?#include<iostream>//#include<cstring>#include<algorithm>using namespace std;_in 阅读全文
posted @ 2012-03-29 08:36 AndyDHG 阅读(177) 评论(0) 推荐(0) 编辑