The Modern C# Challenge
上QQ阅读APP看书,第一时间看更新

8. Greatest common divisors

The greatest common divisor or GCD of two integers A and B, which is written GCD(A, B), is the largest integer C that divides both A and B evenly. For example, GCD(84, 36) = 12 because 12 is the largest integer that divides into both 84 and 36 with no remainder.

Write a program that calculates GCDs. Use the program to verify that GCD(10370370276, 82962962964) = 756.