#include<stdio.h>
int main() {
char str[1001], ans[1001] = { 0 };
int n, j = 0, num = 0;
scanf("%s %d", str, &n);
for (int i = 0; str[i] != '\0'; i++) {
if (i != 0 || str[i] - '0' >= n) {
ans[j++] = (str[i] - '0' + num * 10) / n + '0';
}
num = (str[i] - '0' + num * 10) % n;
}
if (j == 0) {
printf("%d", (str[0] - '0') / n);
}
for (int i = 0; i < j; i++) {
printf("%c", ans[i]);
}
printf(" %d", num);
}
1.字符与数的转换: + '0' 或者- '0'
2.除法竖式计算