Why CE? UVa 575

General topic about Valladolid Online Judge

Moderator: Board moderators

Post Reply
sourav.776
New poster
Posts: 1
Joined: Thu Dec 07, 2017 10:24 pm

Why CE? UVa 575

Post 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;
}
dibery
Learning poster
Posts: 76
Joined: Sat Feb 23, 2013 4:16 pm
Location: Taiwan, Taipei
Contact:

Re: Why CE? UVa 575

Post 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.
Life shouldn't be null.
Nakar81
New poster
Posts: 12
Joined: Sun Sep 18, 2016 6:40 pm

Re: Why CE? UVa 575

Post by Nakar81 »

Remove your code.
Post Reply

Return to “General”