Untitled
unknown
plain_text
3 years ago
245 B
5
Indexable
#include <cmath>
#include <string>
#include <iostream>
using namespace std;
int main()
{
int c = 1;
string a;
cin >> a;
for (int i = 0; i < a.length(); i++)
{
if (a[i] == '0')a[i] = '1';
c += pow(2, i);
}
cout << c-1;
}Editor is loading...