大数乘法&&开根(C++)
#include <iostream>
#include <string>
using namespace std;
//两个字符串相乘
string strMultiply(string str1 , string str2)
{
string strResult = "";
int len1 = str1.length();
int len2 = str2.length();
int num[500] = {
0};
int i = 0, j = 0;
for(i = 0; i < len1; i++)
{
for(j = 0; j < len2; j++)
{
num[len1-1 - i + len2-1 - j] += (str1[i] - '0')*(str2[j] - '0');
}

本文介绍了如何使用C++编程语言来实现大数的乘法运算以及开方根的方法,主要探讨了相关算法的实现细节。
最低0.47元/天 解锁文章
3058

被折叠的 条评论
为什么被折叠?



