Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7. float a;
  8. cin>>a;
  9. cout<<"0.";
  10. while(a>0){
  11. if (a*2>=1)cout<<1;
  12. else cout<<0;
  13. a=a*2;
  14. if (a>=1)a-=1;
  15. }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement