Page 1 of 1

Why CE? UVa 575

Posted: Tue Jan 30, 2018 10:54 pm
by sourav.776
#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;
}

Re: Why CE? UVa 575

Posted: Mon Feb 19, 2018 5:50 am
by dibery
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.

Re: Why CE? UVa 575

Posted: Mon Apr 09, 2018 4:58 pm
by Nakar81
Remove your code.