-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproblem9.c
More file actions
30 lines (26 loc) · 751 Bytes
/
problem9.c
File metadata and controls
30 lines (26 loc) · 751 Bytes
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
29
30
#include <stdio.h>
#include <stdlib.h>
int main(){
for (int a = 1; a < 1000; a++)
{
for (int b = 1; b < 1000; b++)
{
int c_square = a*a + b*b;
for (int i = 1; i*i <= c_square; i++)
{
if (i*i == c_square)
{
int summation = a + b + i;
if (summation == 1000)
{
printf("a = %d\n",a);
printf("b = %d\n",b);
printf("c = %d\n",i);
printf("abc = %d",a*b*i);
return 0;
}
}
}
}
}
}