题解 | #二叉树#
二叉树
https://www.nowcoder.com/practice/f74c7506538b44399f2849eba2f050b5
#include <iostream> using namespace std; int birnaryTree(int m,int n){ if(m<=n){ return 1+birnaryTree(2*m, n)+birnaryTree(2*m+1, n); }else{ return 0; } } int main() { int m,n; while(cin>>m>>n){ if(m==0&&n==0) break; cout<<birnaryTree(m, n)<<endl; } return 0; }