Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class CalculateGCD
- {
- static void Main()
- {
- int a = int.Parse(Console.ReadLine());
- int b = int.Parse(Console.ReadLine());
- int reminder = 1;
- while (reminder != 0)
- {
- reminder = a % b;
- a = b;
- b = reminder;
- }
- Console.WriteLine(a);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement