#include <iostream>
using namespace std;

int funcao(int n, int pot, int bin) {
	
	bin += (n % 2)* pot;
	n = n/2;
	pot = pot *10;
	
	if (n <= 0) {
		return bin;
	}
	bin = funcao(n, pot, bin);
}

int main() {
	int n,pot,bin;

    cout << endl << "  Digite o Numero: ";
    cin >> n;
    pot = 1;
    bin = 0;
    bin = funcao(n, pot, bin);
    //while (n > 0){
    //    bin += (n % 2)* pot;
    //    pot *= 10;
    //    n = n/2;
    //}
    cout << "  " << "Result: " << bin;
    cin.get();
	return 0;
}