#include
using namespace std;
int main() {
int N, sum, numb, rem, base, I;
cin>>N;
for(i=0;i<N;i++){
cin>>numb;
sum = 0;
while( numb != 0){
base = 0;
rem = numb % 10;
if (rem == 1){
sum = sum + (2 * base);
}
base *=2;
numb = numb /10;
}
cout<<sum<<endl;
}
return 0;
}
What’s wrong with the code?