SHARE
TWEET

1

a guest Jun 20th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static public string Sokr()
  2.         {
  3.             Console.WriteLine("Введіть чисельник");
  4.             int p = Convert.ToInt32(Console.ReadLine());
  5.             Console.WriteLine("Введіть знаменник");
  6.             int q = Convert.ToInt32(Console.ReadLine());
  7.             int nod = 0;
  8.             for (int i = 1; i < (p * q + 1); i++)
  9.             {
  10.                 if (q % i == 0 && p % i == 0)
  11.                 {
  12.                     nod = i;
  13.                 }
  14.             }
  15.             int n = nod;
  16.             p = p / n;
  17.             q = q / n;
  18.             string h = Convert.ToString(p);
  19.             string hh = Convert.ToString(q);
  20.             string s =
  21.             return s;
  22.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top