以字符串格式划分两个大数字,简单方法。 [英] Divide two BIG numbers in string format , simple method.

查看:98
本文介绍了以字符串格式划分两个大数字,简单方法。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我需要一种在字符串中划分两个大数字的方法,(控制台应用程序和c ++)

例如:

string s1 =4234823759252523523502525234232 ...(约100个字符数字)

字符串s2 =243423423423......也像上面那样



字符串结果=除(s1,s2);



谢谢。

Hi everyone, I need a method for divide two big numbers in string,( console app. and in c++ )
for example :
string s1 = "4234823759252523523502525234232"...( about 100 char numbers )"
string s2 = "243423423423"...also like above"

string Result = Divide(s1,s2);

Thank you.

推荐答案

这是一个众所周知的与某些类相关的问题,通常称为BigInteger或BigInt。



这些是一些实现:

http://sourceforge.net/projects/cpp-bigint/ [ ^ ],

https://mattmccutchen.net/bigint/ [ ^ ],

https://github.com/technophilis/BigIntegerCPP [ ^ ]。



您可以尝试找到更多: http://lmgtfy.com/?q=C%2B%2B+(BigInteger + OR + BigInt) [ ^ ]。



-SA
This is a well-known problem related to some class which is usually called "BigInteger" or "BigInt".

These are some of the implementations:
http://sourceforge.net/projects/cpp-bigint/[^],
https://mattmccutchen.net/bigint/[^],
https://github.com/technophilis/BigIntegerCPP[^].

You can try to find some more: http://lmgtfy.com/?q=C%2B%2B+(BigInteger+OR+BigInt)[^].

—SA


这篇关于以字符串格式划分两个大数字,简单方法。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆