Hackerblocks von newman problem

i attempted it using bitset datatype, and it gave the right answer but somehow always preceded it by a 0. so i put an if statement in there and it worked for the sample test case though the rest of the testcases still dont pass. here is the code, please guide:
#include
#include
#include
using namespace std;
int main()
{ int n;
cin>>n;
string str;
for(int i=0;i<=n;++i)
{
getline(cin,str);
bitset<16> b(str);
if(i>0){

cout << b.to_ulong() << '\n';  }

}
}

Hello @ilovetocode

Please save your code on ide.codingblocks.com and share the link here.
The code you pasted above is NOT complete.

Here is my code for this question

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

my experience with the doubt clearance process was satisfactory. thank you for your prompt assistance. i did however try to inform you that i figured out my bug and tried replying to the email, which was a noreply( as i noticed later).

Happy to know that your doubt is resolved.
Happy coding !!