SHARE
TWEET

Untitled

a guest Jun 20th, 2019 70 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 сh = Convert.ToInt32(Console.ReadLine());
  5.             Console.WriteLine("Введіть знаменник");
  6.             int zn = Convert.ToInt32(Console.ReadLine());
  7.             int nod = 0;
  8.  
  9.  
  10.             for (int i = 1; i < (сh * zn + 1); i++)
  11.             {
  12.                 if (zn % i == 0 && сh % i == 0)
  13.                 {
  14.                     nod = i;
  15.                 }
  16.             }
  17.             сh = сh / nod;
  18.             zn = zn / nod;
  19.             string strCh = Convert.ToString(сh);
  20.             string strZn = Convert.ToString(zn);
  21.             string s = strCh + "/" + strZn;
  22.             Console.WriteLine(s);
  23.             return s;
  24.         }
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
 
Top