📄 bigint.h
字号:
#pragma once
#include "stdafx.h"
#include <string>
#include <iostream>
#ifndef BI_MAXLEN
#define BI_MAXLEN 80
#define STRLEN 550
#define DEC 10
#define HEX 16
#ifndef PP
#define PP "2765165575700072429096722561505766783073774008029748822940390528325268671408424204039332338576269910385993341406534042617607630962196081510611"
#endif
#ifndef PQ
#define PQ "5319938242328025057485034325562726421733835396778019932500555701077436239437215714047033279743272095226841506013452153477526920620158734090583"
#endif
#ifndef PX
#define PX "18315540073231724132984917741695570530504408884890892070615741712985709660188773640358075524800498924998991267318227490271549594534087"
#endif
using namespace std;
class BigInt
{
public:
unsigned m_nLength;
unsigned long m_ulValue[BI_MAXLEN];
BigInt();
BigInt(const char* val);
~BigInt(void);
void Mov(unsigned __int64 A);
void Mov(BigInt& A);
BigInt Add(BigInt& A);
BigInt Sub(BigInt& A);
BigInt Mul(BigInt& A);
BigInt Div(BigInt& A);
BigInt Mod(BigInt& A);
BigInt Add(unsigned long A);
BigInt Sub(unsigned long A);
BigInt Mul(unsigned long A);
BigInt Div(unsigned long A);
unsigned long Mod(unsigned long A);
BigInt ModPow(BigInt&B,BigInt&N);
BigInt ModPow(int&B,BigInt &N);
long GetFirstValue();
int Cmp(BigInt& A);
void GetStr(char* str, unsigned int system=DEC);
void PutStr(const char* str, unsigned int system=DEC);
private:
void Reverse(char * s, int len);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -