文章

25

粉丝

0

获赞

101

访问

4.4k

头像
二叉树 题解:
P1233 北京大学机考题
发布于2026年2月18日 18:09
阅读数 195

#include <bits/stdc++.h>
using namespace std;

int main(){
    int a,b;
    while(cin>>a>>b){
        while(a!=b){
            if(a<b)
                swap(a,b);
            a/=2;
        }
        cout<<a<<endl;
    }
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发