Go: 
package main

import (
	"fmt"
	"math"
)

func solve(n int) int {
	i := 0
	for {
		if val := math.Pow(2, float64(i)); val*2 > float64(n) {
			return int(val)
		}
		i++
	}
}

func main() {
	for {
		var n int
		_, err := fmt.Scan(&n)
		if err != nil {
			break
		}

		res := []int{}
		for {
			val := solve(n)
			res = append(res, val)
			n -= val

			if n <= 0 {
				break
			}
		}

		for i := range res {
			if i != 0 {
				fmt.Print(" ")
			}
			fmt.Print(res[len(res)-i-1])
		}
		fmt.Println()
	}
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;

int main() {
	for (int n; cin >> n; ) {
		for (int i = 0; (n >> i); i++) if ((n >> i) & 1) cout << (1 << i) << ((n >> (i + 1)) ? ' ' : '\n');
	}
	
	return 0;
}

C++: #include <stdio.h>
int main(){
int n,temp;
while(scanf("%d",&n)!=EOF){
temp=1;
while(temp<=n)temp*=2;
temp/=2;
printf("%d",temp);
n-=temp;
while(n>0){
while(temp>n)temp/=2;
n-=temp;
printf(" %d",temp);
}
printf("\n");
}
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<map>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define EPS (1e-10)
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

int main(){
  int n;
  while(cin>>n){
    int i = 1;
    bool f = true;
    while(i != 1024){
      if((n&i)!=0){
	if(f) f=false;
	else printf(" ");
	printf("%d",i);
      }
      i <<= 1;
    }
    puts("");
  }
  return 0;
}

C++: #include<cmath>
#include<cstdio>
#include<iostream>

using namespace std;
 
int main(){
	int w[]={1,2,4,8,16,32,64,128,256,512};
	int n;

	while(scanf("%d",&n)!=EOF){
		int a[10]={0};
		int i=10, j=0;

		while(0<n&&0<=i){
			if(w[--i]<=n){
				a[i]=1;
				n-=w[i];
				++j;
			}
		}

		for(i=0,--j; i<10&&0<j; ++i,--j)
			if(a[i])	printf("%d ", w[i]);

		for(; i<10; ++i)
			if(a[i])	printf("%d\n", w[i]);
	}

    return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;

int main() {
	short int n;
	while (cin >> n) {
		for(int i=1; n>0; i*=2,n/=2){
			if (n % 2 == 1) {
				cout << i<<" ";
				//if (n > 1)
					//cout << " ";
			}
		}
		cout << "\b" << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
#include<map>
#include<vector>
#define int long long
using namespace std;
int test[51];
signed main() {
    int n;
    while (cin >> n) {
        int a = 0;
        if (n >= 512) { test[a] = 512; a++; n -= 512; }
        if (n >= 256) { test[a] = 256; a++; n -= 256; }
        if (n >= 128) { test[a] = 128; a++; n -= 128; }
        if (n >= 64) { test[a] = 64; a++; n -= 64; }
        if (n >= 32) { test[a] = 32; a++; n -= 32; }
        if (n >= 16) { test[a] = 16; a++; n -= 16; }
        if (n >= 8) { test[a] = 8; a++; n -= 8; }
        if (n >= 4) { test[a] = 4; a++; n -= 4; }
        if (n >= 2) { test[a] = 2; a++; n -= 2; }
        if (n >= 1) { test[a] = 1; a++; n -= 1; }
        sort(test, test + a);
        for (int h = 0; h < a; h++) {
            if (h != a - 1)cout << test[h] << ' ';
            else cout << test[h];
        }
        cout << endl;
    }
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(itr,c) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE

int main(){
  int i,in;
  char to[12];
  int w[10] = {1,2,4,8,16,32,64,128,256,512};

  while(cin >> in){
  vector<int> ans;
    for(i=0;in;i++){ to[i] = in%2; in /= 2;}
    rep(i,12) if(to[i] == 1) ans.push_back(w[i]);
    reverse(ans.begin(),ans.end());
    for(i = ans.size()-1; i >= 0; i--){
      cout << ans[i];
      (i == 0) ? cout << endl : cout << " ";
    }
  }


  return 0;
}

C++: 
#include <iostream>

using namespace std;

int main() {
    int N;
    while(cin >> N) {
        bool first = true;
        for(int i = 1; i <= N; i <<= 1) {
            if(N & i) {
                if(!first) cout << ' ';
                cout << i;
                first = false;
            }
        }
        cout << endl;
    }
    return 0;
}

C++: #include <iostream>

int main(){
	int a,b,c=1;
	int d[10];
	
	while(std::cin>>a){
		
		for(b=0;b<2;b++){
			if(a==b){
				d[1]=b;
			}else{
				for(c=0;c<3;c=c+2){
					if(a==b+c){
						d[1]=b;
						d[2]=c;
						
						
					}else{
						for(int e=0;e<5;e=e+4){
			if(a==b+c+e){
				d[1]=b;
				d[2]=c;
						d[3]=e;
					
			}else{
				for(int f=0;f<9;f=f+8){
					if(a==b+c+e+f){
						d[1]=b;
						d[2]=c;
						d[3]=e;
						d[4]=f;
						
					}else{
						for(int g=0;g<17;g=g+16){
			if(a==b+c+e+f+g){
				d[1]=b;
				d[2]=c;
						d[3]=e;
						d[4]=f;
						d[5]=g;
						
			}else{
				for(int h=0;h<33;h=h+32){
					if(a==b+c+e+f+g+h){
						d[1]=b;
						d[2]=c;
						d[3]=e;
						d[4]=f;
						d[5]=g;
						d[6]=h;
						
					
					}else{
						for(int i=0;i<65;i=i+65){
			if(a==b+c+e+f+g+h+i){
				d[1]=b;d[2]=c;
						d[3]=e;
						d[4]=f;
						d[5]=g;
						d[6]=h;
						d[7]=i;
						
			}else{
				for(int j=0;j<129;j=j+128){
					if(a==b+c+e+f+g+h+i+j){
						d[1]=b;
						d[2]=c;
						d[3]=e;
						d[4]=f;
						d[5]=g;
						d[6]=h;
						d[7]=i;
						d[8]=j;
						
					}else{
						for(int k=0;k<257;k=k+256){
			if(a==b+c+e+f+g+h+i+j+k){
				d[1]=b;
				d[2]=c;
						d[3]=e;
						d[4]=f;
						d[5]=g;
						d[6]=h;
						d[7]=i;
						d[8]=j;
						d[9]=k;
						
			}else{
				for(int l=0;l<513;l=l+512){
					if(a==b+c+e+f+g+h+i+j+k+l){
						d[1]=b;
						d[2]=c;
						d[3]=e;
						d[4]=f;
						d[5]=g;
						d[6]=h;
						d[7]=i;
						d[8]=j;
						d[9]=k;
						d[10]=l;
					}else{
						
					}
				}
			}
			
		}
					}
				}
			}
			
		}
					}
				}
			}
			
		}
					}
				}
			}
			
		}
					}
				}
			}
			
		}
		for(int m=1;m<11;m++){
		if(d[m]!=0){
			std::cout<<d[m];
		}
	}
	std::cout<<std::endl;
	}
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int n, s;
int main() {
	while (true) {
		cin >> n; s = 0;
		for (int i = 1; i < 31; i++) {
			if ((n / (int)pow(2, i)) % 2 == 1) {
				if (s) { cout << ' '; }
				cout << pow(2, i - 1); s++;
			}
		}
		cout << endl;
	}
}

C++: #include<iostream>

using namespace std;

int main(){
	int x;
	while(cin>>x){
		for(int i=0;i<10;i++){
			if((x>>i)&1)cout<<(1<<i)<<" ";
		}
		cout<<endl;
	}
}

C++: #include<stdio.h>
int main(){
	int a;
	while(~scanf("%d",&a)){
		for(int i=0;i<10;i++)if(1<<i&a)printf(1<<i+1>a?"%d":"%d ",1<<i);
		printf("\n");
	}
}