跳到正文

个人记录

T3

joe303约 1 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年4月6日
篇幅
约 1 分钟

版本

  1. v1当前
C++
#include <bits/stdc++.h>
using namespace std;
long long n,T,m,i;
int main()
{
    cin>>T;
    while(T--){
        cin>>n,m=i=0;
        while(n){
            m=m*2+n%2;
            n/=2,i++;
        }
        for(i;i<32;i++)m*=2;
        cout<<m<<endl;
    }
	return 0;
}
原文