#include <stdio.h>

int main() {
    int n,b;
    char num[1000];
    scanf("%d %d",&n, &b);
    int i=0;
    while(n>0) {
        if(n%b>=10 && n%b<=35) {
            num[i++]=n%b+55; //55
        } else {
            num[i++]=n%b+48; //48
        }
        n/=b;
    }
    for(int j=i-1; j>=0; j--) {
        printf("%c",num[j]);
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: