Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <cmath>
- using namespace std;
- int main()
- {
- float suma=0;
- string a;
- cin.ignore(2);
- cin>>a;
- for(int i=0;i<a.length();i++)
- {
- suma+=(a[i]-'0')*pow(2,-i-1);
- }
- cout<<suma;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement