Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. using System;
  2.  
  3. class CalculateGCD
  4. {
  5. static void Main()
  6. {
  7. int a = int.Parse(Console.ReadLine());
  8. int b = int.Parse(Console.ReadLine());
  9. int reminder = 1;
  10.  
  11. while (reminder != 0)
  12. {
  13. reminder = a % b;
  14. a = b;
  15. b = reminder;
  16. }
  17.  
  18. Console.WriteLine(a);
  19.  
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement