include stdafx include math include iostream using namespace std void

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "stdafx.h"
#include "math.h"
#include <iostream>
using namespace std;
void f (int n)
{ int* b= new int [n];
int j=0;
while (n!=0)
{
b[j++]=n%2;
n=n/2;
}
for (int i=j-1; i>=0; i--) cout<<b[i];
}
void main()
{ int n;
cin>>n;
if (n>0) f(n);
}