Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp6
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. Console.Write("n=");
  10. int n = int.Parse(Console.ReadLine());
  11. for (int x = 1; x <= n; x++)
  12. {
  13. for (int y = 1; y <= n; y++)
  14. {
  15. for (int z = 1; z <= n; z++)
  16. {
  17. if (x * x + y * y == Math.Pow(z,3))
  18. Console.WriteLine("{0}^2+{1}^2={2}^3", x, y, z);
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement