以下代码使⽤了辗转相除法求解最⼤公因数 ,请在横线处填⼊( ) ,使其能正确实现相应功能。
1 int gcd(int a, int b) { 2 while (b != 0) { 3 _________________________ 4 } 5 return a; 6 }
int temp = b; b = a / b; a = temp;
int temp = a; a = b / a; b = temp;
int temp = b; b = a % b; a = temp;
b = a % b; a = b;