单选题

程序的输出为( )

发布于 2022-03-03 14:07:49

#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
被浏览
6
知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看