贝贝与外星人
#include<iostream> #include<string> #include<stdio.h> #include<algorithm> #include<cstring> #include<cstdio> #include <math.h> using namespace std; float b; int main(){ scanf("%f",&b); cout<<"0."; for(int i = 0;i<3;i++) { b = b*2; if(b>=1) { cout<<"1"; b = b -1; } else cout<<"0"; } cout<<endl; //printf("%s\n",a); return 0; }