bigint.h

来自「本算法实现2-10集合划分问题,采用动态规划法和大整数方法」· C头文件 代码 · 共 30 行

H
30
字号
#include <stdio.h>

struct IntNode
{
	int		Data;
	IntNode *Prev, *Next;
};

class BigInteger
{
	int			sign;
	IntNode		*head, *end, *curNode;

	void Reset();
	int AbsCompare(const BigInteger &bi1, const BigInteger &bi2);
	void RemoveZeroOfHead();
	void AddNodeAtHead(int dat);
	void AddNodeAtEnd(int dat);
public:
	bool GetNum( char* input );
	void Print( FILE* stream = stdout );
	BigInteger operator + (const BigInteger &bi);
	BigInteger operator *(const int i);
	BigInteger& operator = (const BigInteger &bi);
	BigInteger();
	BigInteger(const int i);
	BigInteger(const BigInteger &bi);
	~BigInteger();	
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?