#include
using namespace std;
void decToBin(int dec)
{
if(dec>0)
{
decToBin(dec/2);
cout<
}void main()
{
int a,b;
cout<<"请输入要转换的十进制数。"<
decToBin(a);
}
#include
using namespace std;void Dec2Binary(int num)
{
if(num){
Dec2Binary(num >> 1);
cout<< (num&1);
}
}int main()
{
int num;
cout<<"enter a number:"<
Dec2Binary(num);
return 0;
}