题解 | #二叉树#
二叉树
https://www.nowcoder.com/practice/f74c7506538b44399f2849eba2f050b5
#include <cstdio> int Tree(int m,int n){ if (m > n){ return 0; } else{ return Tree(2 * m,n) + Tree(2 * m + 1,n) + 1; } } int main(){ int m,n; scanf("%d%d",&m,&n); while (m == 0){ break; } printf("%d\n",Tree(m,n)); }