#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
char c[1001];
scanf("%s",c);
int d;
cin>>d;
int i = 0;
int reminder = c[0]-'0';
while(c[i]!='\0'){
if(reminder>d){
cout<<reminder/d;
if(c[i+1]!='\0')reminder = ((reminder)%d)*10+(c[i+1]-'0');
else reminder = reminder%d;
}
else{
if(c[i+1]!='\0')reminder = (reminder)*10+c[i+1]-'0';
if(reminder<d)cout<<'0';
}
i++;
}
if(c[1]=='\0')cout<<reminder/d;
cout<<' '<<reminder;
}
对123456789050987654321 7输入样例应该输出17636684150141093474 3,可是我输出的是1763668415141093474 3少了一个0求解。