Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * C# Program to Find a Number using Pythagoras Theorem
- */
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- class Program
- {
- static void Main(string[] args)
- {
- double a, b, c;
- bool answer = false;
- for (int n = 0;answer ==false ; n++)
- {
- a = n;
- for (int i = 0; i < n; i++)
- {
- b = a - i;
- for (int x = 0; x < b; x++)
- {
- c = b - x;
- if (c == Math.Sqrt(a * a + b * b) && a + b + c == 1000)
- {
- double d = (a * b * c);
- Console.WriteLine(d);
- Console.ReadLine();
- }
- }
- }
- }
- Console.ReadLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement