#include <iostream>
#include <stack>
using namespace std;
void DTB(int num){
if(num<=0) return;
stack<char> numstack;
while(num>0){
numstack.push(num%2);
num/=2;
}
while(!numstack.empty()){
cout<<(int)numstack.top();
numstack.pop();
}
cout<<'\n';
}
void DTB_Recur(int num){
if(num<=0) return;
if(num==0||num==1)
cout<<num;
else{
DTB_Recur(num/2);
cout<<num%2;
}
}
int main(){
int n=13;
DTB(n);
DTB_Recur(n);
}