Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main(){
- float a;
- cin>>a;
- cout<<"0.";
- while(a>0){
- if (a*2>=1)cout<<1;
- else cout<<0;
- a=a*2;
- if (a>=1)a-=1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement