求C语言写的高精度除法代码!!!!!!

来源:百度知道 编辑:UC知道 时间:2024/05/31 02:36:40
最近老是碰到高精度的题目,我自己有不会写高精度除法代码,求高手帮帮忙!!!!!!!!!
我不是要精度高,不要精确到小数点很多位,我要能计算大整数相除的代码:比如:1234567898745633333332000000014789/12311222222222211111111111.

这个不是C语言。是pas语言。。。。不过看看把,差不多。
其实这个算法不难,就是数组模拟除法操作,稍微想象很容易的。Acm比赛中的基本算法。
我没有写这个程序,从信息初学者那里找了两个算法,pascal写的,根据你用的语言自己转化下吧,以前用c++写的找不到了:(

除法 1 : 高精度数 / 单精度数

{
Author : tenshi
Date : 2002-03-10
Problem : High Precision --- Divide
Algorithm : simple
Input : two lines,
1st line : a positive HighPrecision Number
2nd line : a positive Low Precicion Number
Output : times & rest of the two Numbers
}
program HighPrecision3_Multiply1;
const
fn_inp='hp5.inp';
fn_out='hp5.out';
maxlen=100; { max length of the number }
type
hp=record