看了http://lovnet.iteye.com/blog/1690276的答案

好巧妙的方法

递归实现十进制向m进制转换

#include "stdio.h"
int m;
void CK(int n)
{
    if(n>=m)
        CK(n/m);
    printf("%d",n%m);
}
int main()
{
    int a,b;
    while(~scanf("%d",&m)&&m)
    {
        scanf("%d%d",&a,&b);
        CK(a+b);
        printf("\n");
    }
    return 0;
}

 

相关文章:

  • 2021-10-08
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2021-05-21
  • 2021-09-04
  • 2022-01-07
猜你喜欢
  • 2022-03-03
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
  • 2021-10-27
  • 2021-07-22
  • 2022-12-23
相关资源
相似解决方案