#include <stdio.h>

int a,b,c; //a dividendo e b divisore (base)

int main() {
    scanf("%d", &a);
    scanf("%d", &b);
    if(a==0) {
        printf("0");
    }
    while(a>0) {
        c=0;
        while(a>=b) {
            a=a-b;
            c=c+1;
        }
    printf("%d", a);
        a=c;  
    }
}

Embed on website

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