1、数字 a、b、c,求max(a,b,c)
public int max3(
int a,
int b,
int c) {
return a > b ? a > c ? a : c : b > c ?
b : c;
}
2、求两个数a、b的最大公约数
public int gcd(
int x,
int y) {
if (y == 0
) {
return 0
;
} else {
return gcd(y, x %
y);
}
}
转载于:https://www.cnblogs.com/GG-Bond/p/11571218.html