///...................SUBHASHIS MOLLICK....................///
///.....DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING....///
///.............ISLAMIC UNIVERSITY,BANGLADESH.............///
///.....................SESSION-(14-15)....................///
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<ctype.h>
#include<bits/stdc++.h>
using namespace std;
main()
{
char s[100000]={0};
while(gets(s))
{
long long l=strlen(s);
long long i,j=l,k,sum1=0,sum=0;
if(l==1 && s[0]==48)
break;
else
{
for(i=0;i<l;i++)
{
long long a=pow(2,j)-1;
sum=(s[i]-48)*a;
sum1=sum1+sum;
j--;
}
printf("%ld\n",sum1);
}
}
}
///.....DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING....///
///.............ISLAMIC UNIVERSITY,BANGLADESH.............///
///.....................SESSION-(14-15)....................///
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<ctype.h>
#include<bits/stdc++.h>
using namespace std;
main()
{
char s[100000]={0};
while(gets(s))
{
long long l=strlen(s);
long long i,j=l,k,sum1=0,sum=0;
if(l==1 && s[0]==48)
break;
else
{
for(i=0;i<l;i++)
{
long long a=pow(2,j)-1;
sum=(s[i]-48)*a;
sum1=sum1+sum;
j--;
}
printf("%ld\n",sum1);
}
}
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন