程序的输出为( )
发布于 2022-03-03 14:08:41
#include<bits/stdc++.h> using namespace std int solve(int x){ if(x == 0 || x == 1){ return x } if(x % 2 == 0){ return 1 + solve(x / 2) } else{ return 1 + solve((x + 1) / 2) } } int main(){ int n = 100 int ans = solve(n) cout<<ans<<endl return 0 }
程序的输出为( )
登录后免费查看答案
关注者
0
被浏览
5