50分,求助!!!
查看原帖
50分,求助!!!
1094233
HZT1121楼主2024/5/14 13:24
# include <cstdio>
using namespace std;

int main(){
    int n, j, x = 0;
    scanf("%d %d", &n, &j);
    while(n >= j && n >= 0)
    {
        x = x * 10 + n / j;
        n -= (n / j) * j;
    }
    if(j <= 9)
    {
        x = x * 10 + n;
        printf("%d", x);
    }
    else
    {
        printf("%d%c", x, char('A' + n - 10));
    }
    
    return 0;
}
2024/5/14 13:24
加载中...