int main() { string s=Stdio.stdin.gets(); int i=strlen(s); int res=0; int j=i-1; while(j>=0){ if(s[j]==49){ res= res+pow(2,i-j-1); } j = j-1; } write("%d\n",res); return 0;}
1100001001101101000011010010010111011011100000111010000000111000010110111000111010010000001100010010
962750830540646534807386915602
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!