1、用辗转相除法计算两个数的最大公约数
public class Main{
public static void main(String[] args) {
int u = 15;
int v = 23;
int temp;
while(v!=0)
{
temp = u%v;
u = v;
v = temp;
}
System.out.println(u);
}
}
标签:temp,int,System,static,算数,Main,public
来源: https://www.cnblogs.com/feimanzhh/p/15641636.html