include
include
include
using namespace std;
stack<int>st;
int main(){
    int a;
    int b[100];
    while(cin>>a){//循环输入
        int i=0;
        while(a!=0){//做模2除法
            b[i]=a%2;
            a=a/2;
            i++;
        }
        for(int j=0;j<i;++j)//用栈做逆序输出
            st.push(b[j]);
        int x=0;
        while(!st.empty()){
            b[x]=st.top();
            st.pop();
            x++;
        }
        for(int j=0;j<i;j++)
            cout<<b[j];
        cout<<endl;
    }
    return 0;
}</int>

京公网安备 11010502036488号