跪求~~FFT实现大数乘法的C++源代码!!

来源:百度知道 编辑:UC知道 时间:2024/05/18 01:04:06
小弟跪求~哪位大虾帮帮忙。先谢了!

从文件读取数字和运算,格式是第一行为数字,第二行为数字,第三行为运算符,加减乘正负都可以,你稍微改一下即可

/*************************************
*
* Description: The program can do addition, substraction and multiplication for
* arbitrary large numbers.
* For example, after reading in
* 29384987634765182734
* 18293784765342891872
* *
* the program will print
* 537562639122656557670471733298083338048
*************************************/

#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;

/**
* 1. Least significant digit is in the right end of the list
* 2. List is implemented as double linked list with dummy head
**/
struct Node{
unsigned digit;
Node* next;
Node* previous;
};

void insertTail(Node* const list, unsigned digit);
void insertHead(Node* const list, unsigned digit);