#include<iostream> #include<string> using namespace std; long long n; int main() { cin>>n; while(n) //当n不为0的时候执行while循环 { cout<<n<<" "; //输出n的值 n/=2; //将n除2 } return 0; }