提交时间:2022-08-03 15:46:22

运行 ID: 56882

#include<bits/stdc++.h> using namespace std; int a; void xxx(int a) { int b[1000],ans=1; int i=0; while(a%2==0) { b[i]=a%2; a/=2; i++; } for(int j=1;j<=i;j++)ans*=2; cout<<ans<<endl; } int main() { while(1) { cin>>a; if(a==0)break; xxx(a); } return 0; }