-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path39.c
28 lines (26 loc) · 1.2 KB
/
39.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include<stdio.h>
#include<conio.h>
void main()
{
int p,a,b,c;
int t,save,max;
max=0;
for(p=12;p<=1000;p++)
{ t=0;
for(a=1;a<p;a++)
{
for(b=a+1;b<p;b++)
{
for(c=b+1;c<=p-(a+b);c++)
{
if(((a*a)+(b*b)==c*c)&&(a+b+c==p))
{
t++;
}
}
}
if(t>max){max=t;save=p;}
}
}
printf("%d\t%d",save,max);
}