-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEulerNine.cs
32 lines (31 loc) · 917 Bytes
/
EulerNine.cs
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
31
32
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ProjectEulerNine
{
class Program
{
public static void Main()
{
int x, y, z;
for (x = 200; x < 500; x++)
{
for (y = 2; y < 500; y++)
{
for (z = 2; z < 500; z++)
{
if ((x*x) + (y*y) == (z*z) && ((x+y+z) == 1000))
{
Console.WriteLine("x = " + x + ", y = " + y + ", z = " + z);
Console.WriteLine("x + y + z = " + (x + y + z));
Console.WriteLine("x * y * z = " + (x * y * z));
Console.ReadLine();
break;
}
}
}
}
}
}
}