Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main()
- {
- Console.WriteLine("Please, enter the a = ");
- int a = int.Parse(Console.ReadLine());
- Console.WriteLine("Please, enter the b = ");
- int b = int.Parse(Console.ReadLine());
- int chs = (a * a + b * b);
- int znam = (a * b);
- int l = chs;
- int k = znam;
- while (l!=k)
- {
- if (l > k)
- {
- l -= k;
- }
- else
- {
- k -= l;
- }
- }
- chs = chs / l;
- znam = znam / l;
- Console.WriteLine("{0}/{1}", chs, znam);
- }
- }
- }
RAW Paste Data