1017 A除以B
时间:2022-10-15 01:00:00
这个问题需要计算A/B,其中A是不超过 1000 位的正整数,B是 1 位正整数。您需要输出商数Q和余数R,使得A=B×Q R成立。
输入格式:
在一行中依次输入A和B,中间以 1 空格分隔。
输出格式:
在一行中依次输出Q和R,中间以 1 空格分隔。
输入样例:
123456789050987654321 7
输出样例:
17636684150141093474 3
#include #include #include void sc(char [],int ); int main(void) { char bcs[1000]; int cs; scanf("%s %d",bcs,&cs); sc(bcs,cs); return 0; } void sc(char bcs[],int cs) { int cd = strlen(bcs); int wei = ((bcs[0]-'0')1); int ys = ((bcs[0]-'0')(bcs[0]-0) { printf("%d %d",0,(bcs[0]-0); return; } while(wei