#include<bits/stdc++.h> using namespace std; char s[100]; int main(){ cin >> s+1; int n = 0; for(int i = 1; s[i] != '\0'; i++){ n = n*2 + s[i] - '0'; } // for(int i = strlen(s+1), p=1; i; i--, p*=x){ // n += (s[i] - '0')*p; // } cout << n; return 0; }
本OJ不对外开放
本题库为可达信奥编程题库,仅对内部学员开放。
内部学员请联系班主任开通题库账号。
使用您的 可达信奥 通用账户