#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; }
使用您的 可达信奥 通用账户