From d85abe3a4d64005e7df12c31967318485d023852 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Wed, 27 Apr 2016 18:43:14 +0800 Subject: [PATCH] Create 1651.cpp --- QUSTOJ/1651.cpp | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 QUSTOJ/1651.cpp diff --git a/QUSTOJ/1651.cpp b/QUSTOJ/1651.cpp new file mode 100644 index 0000000..917f2c8 --- /dev/null +++ b/QUSTOJ/1651.cpp @@ -0,0 +1,66 @@ +#include +#include +#include +using namespace std; + +//Kiritow's BIGN (class BigNumber) Written on Nov. 12th, 2015 +//Original Version: Build 1 (Version 2) +//CCBIGN : from BIGN (Build 1 -version 2) +class ccbign +{ +public: + //WARNING: We use public here to reduce time consumed on Interface, although this is not a recommended way + int data[3000]; + int length; + ccbign() + { + length=0; + } + void set_empty() + { + memset(data,0,sizeof(int)*3000); + } +}; + +int ConvertSTRtoCCBIGN(const char* incstr,ccbign& incbign) +{ + int len=strlen(incstr); + for(int i=0;i0;times--) + { + a.set_empty(); + gets(buff); + int len=ConvertSTRtoCCBIGN(buff,a); + for(int i=0;i