#include
#include<string.h>
#include
using namespace std;
int main() {
int n,i;
cin>>n;
for(i=0;i<n;i++)
{string s;
cin>>s;
int sum=0;
int l;
l=s.length();
l=l-1;
for(int j=l;j>=0;j++)
{
sum=sum+int(s[j])*pow(2,l-j);
cout<<sum<<endl;
}
}
return 0;
}
where am i making mistake.