Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Task24 {
- public static int gcd(int a, int b) {
- while (b > 0) {
- a %= b;
- int tmp = a;
- a = b;
- b = tmp;
- }
- return a;
- }
- public static int gcd4(int a, int b, int c, int d) {
- return gcd(gcd(gcd(a, b), c), d);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement