01 #include<bits/stdc++.h> 02 using namespace std; 03 int p; 04 void fun(int & x, int & y); 05 void func(int & x, int & y) { 06 if (y > x) return; 07 x--; 08 y /= 2; 09 fun(x, y); 10 } 11 void fun(int & x, int & y) { 12 if (x == 1) return; 13 x /= 2; 14 y += p; 15 func(x, y); 16 } 17 int main() { 18 int x, y; 19 cin >> x >> y >> p; 20 fun(x, y); 21 cout << x << ' ' << y; 22 return 0; 23 }
1. 将第 4 行的 & 去除后,程序仍能通过编译。
2. 读入的 x,y,p 为 int 范围内任意值时程序均能完成运行。
3. 若 x = 1 时,输出的 x,y 与输入的一致。
4. 输出的 x 必然小于等于输入的 x
5. 输入为 7 33 2 时,输出为( )
6. 输入为 33 7 2 时,输出为( )