Advertisement
Guest User

1

a guest
Mar 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System;
  2.  
  3. namespace fifth
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var a = int.Parse(Console.ReadLine());
  10.             var b = int.Parse(Console.ReadLine());
  11.             while (b != 0)
  12.             {
  13.                 var oldB = b;
  14.                 b = a % b;
  15.                 a = oldB;
  16.             }
  17.             Console.WriteLine("GCD = {0}", a);
  18.  
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement