为什么不能用递归呢?

071maozihan 2022-04-20 7:46:18 21 返回题目

#include<bits/stdc++.h>

#define int long long

using namespace std;

int n;

int f(int x)

{

if(x % 2 == 0)return f(x/2)+1;

else return 0;

}

signed main()

{

cin>>n;

cout<<f(n);

return 0;

}

{{ vote && vote.total.up }}