Run ID:162646

提交时间:2026-10-18 09:58:19

#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int l=s.size(),i=0; double q=1,shi=0; while(s[i]!='.') i++; for(int k=i-1;k>=0;k--){ shi+=(s[k]-'0')*q; q*=2; } q=2; for(i+=1;i<l;i++){ shi+=(s[i]-'0')/q; q*=2; } cout<<shi<<endl; return 0; }