Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp6
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("n=");
- int n = int.Parse(Console.ReadLine());
- for (int x = 1; x <= n; x++)
- {
- for (int y = 1; y <= n; y++)
- {
- for (int z = 1; z <= n; z++)
- {
- if (x * x + y * y == Math.Pow(z,3))
- Console.WriteLine("{0}^2+{1}^2={2}^3", x, y, z);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement