#include<bits/stdc++.h>
using namespace std;
int main()
{
char ar[101];
while(true)
{
gets(ar);
int l=strlen(ar);
long dec=0;
for(int i=0;i<l;i++)
{
dec+=(pow(2,l-i)-1)*(ar-'0');
}
if(dec!=0)cout<<dec<<endl;
else break;
}
return 0;
}
Why CE? UVa 575
Moderator: Board moderators
Re: Why CE? UVa 575
Submit as C++11.
The C++ option does not support gets().
BTW, you should be able to read to compilation error message in your submission page.
The C++ option does not support gets().
BTW, you should be able to read to compilation error message in your submission page.
Life shouldn't be null.
Re: Why CE? UVa 575
Remove your code.