Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int convertToB10(const char s[])
- {
- int ans = 0;
- for (int i = 0; s[i]; i++)
- ans = ans * 2 + s[i] - '0';
- return ans;
- }
- int main()
- {
- string s;
- cin >> s;
- cerr << convertToB10(s.c_str());
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement