acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 题解

    userId_undefined

    法兰西玫瑰

    倔强青铜
    89阅读
    0回复
    1点赞
  • 老师上课教的题解

    #include<cstdio> #include<cstdlib> #include<cstring> const int N=100; int n,m; int a[N]; char sa[10]={'A','B','C','D','E','F','G','H','I','J'}; int main() { scanf("%d%d",&n,&m); int tot=0; while(n!=0) { a[tot]=n%m; n/=m; if(a[tot]<0) a[tot]-=m,n; } for(int i=tot;i>=1;i--) { if(a[i]<10) printf("%d",a[i]); else printf("%c",sa[a[i]-10]); } } 包对的~

    userId_undefined

    莱欧斯利

    倔强青铜
    50阅读
    0回复
    0点赞
首页