您好,欢迎来到九壹网。
搜索
您的当前位置:首页进制转换(张老师)

进制转换(张老师)

来源:九壹网
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define PII pair<int,int >
#define int long long 
#define IOS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
 
using namespace std;
 
const int N = 1e6+10;
 
int n,m;
int va[N],cnt = 0;
 
signed main()
{
    IOS;
    int x;
    cin>>x;
    while(1)
    {
        int now = x%2;
        va[++cnt] = now;
        x /= 2;
        if(x==0) break;
    }
    for(int i=cnt;i>=1;i--) cout<<va[i];
}

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 91gzw.com 版权所有 湘ICP备2023023988号-2

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务