#include "iostream"
#include "stdio.h"
#include <vector>
#include <cstring>
#include <algorithm>
#include <string>
#include <string.h>
#include <stack>
#include <ctype.h>
#include <functional>
#include <math.h>
using namespace std;
//1129
string s;
int main(){
//freopen("input.txt","r",stdin);
while(cin>>s && s!="0"){
long long int res=0;
for(int i=0;i<s.length();i++){
res+=(s[i]-'0')*(pow(2.0,(s.length()-i)*1.0)-1);
}
cout<<res<<endl;
}
return 0;
}
/**************************************************************
Problem: 1129
User: cust123
Language: C++
Result: Accepted
Time:20 ms
Memory:1608 kb
****************************************************************/
题目1129:Skew数
最新推荐文章于 2022-04-29 16:39:19 发布