#include <stdio.h>
typedef struct
{
int data[100];
int top;
}st;
void main()
{
st st;
st.top=-1;
int N=10;
int b=0;
while(N>1)
{
b=N%2;
st.data[++st.top]=b;
N/=2;
}
st.data[++st.top]=N;
while (st.top!=-1)
printf("%d ",st.data[st.top--]);
}
10进制转2进制
最新推荐文章于 2023-02-17 11:28:00 发布