#11231: C++


za455096 (455096)

學校 : 臺北市私立延平高級中學
編號 : 57236
來源 : [203.72.178.252]
最後登入時間 :
2018-03-28 11:02:28
d236. 畢氏的定理 -- Project Euler | From: [203.72.178.252] | 發表日期 : 2016-08-02 14:07

#include <iostream>
#include<cmath>
#include<stdlib.h>
using namespace std;
int main()
{
int a,b,c;
for(a=1 ;a<999 ;a++)
{
for(b=a ;b<(999-a) ;b++)
{
if(a+b>500)
{
int c=(int)sqrt(a*a+b*b);
if(c*c==a*a+b*b && a+b+c==1000)
{cout<< a*b*c <<endl;break;}
}
}
}
return 0;
}

 
ZeroJudge Forum