```123456789050987654321 7
```

`17636684150141093474 3`

``````<pre name="code" class="java">import java.math.BigInteger;
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
BigInteger a,b,c,d;//a是被除數，b是除數，c是商，d是餘數
a=new BigInteger(sc.next());
b=new BigInteger(sc.next());
c=a.divide(b);//求商
d=a.remainder(b);//求餘數
System.out.println(c " " d);
}
}``````

=======分割線=========

6月11日補充，python實現

``````a=[int(i) for i in raw_input().split()]
c=int(a[0]/a[1])
d=a[0]%a[1]
print c,d``````

=========

``````#include<iostream>
#include<string>
using namespace std;
int main()
{
string a, q;//把商儲存在字串裡
int b, r= 0;
cin >> a >> b;
int temp = a[0] - '0';
if (temp >= b)
{
q.push_back(temp / b   '0');//商轉換成字元再儲存
}
for (int i = 1;i<a.size();i  )
{
r= temp%b;
temp = r* 10   a[i] -48;
q.push_back(temp / b  48);
}
r= temp%b;
if (a.size() == 1 && a[0] - 48 < b)//A只有一位且比B小的情況
{
cout << 0 <<' '<< a[0] - 48;
}
else
{
cout << q << " " << r;//輸出商和餘數
}
//system("pause");
return 0;
}``````