From eb30013592ee1895e6053654192f4ecbffecb9a2 Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Thu, 28 Apr 2016 08:53:24 +0800 Subject: [PATCH] Create 1017.cpp --- QUSTOJ/1017.cpp | 72 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 QUSTOJ/1017.cpp diff --git a/QUSTOJ/1017.cpp b/QUSTOJ/1017.cpp new file mode 100644 index 0000000..68eab79 --- /dev/null +++ b/QUSTOJ/1017.cpp @@ -0,0 +1,72 @@ +#include +#include +#include +using namespace std; + +//Kiritow's BIGN (class BigNumber) Written on Nov. 12th, 2015 +//Original Version: Build 1 ( Version 2 ) +class bign +{ +public: + //WARNING: We use public here to reduce time consumed on Interface, although this is not a recommended way. + int data[20480]; + void set_empty() + { + memset(data,0,sizeof(int)*20480); + } + int lenx() + { + for(int i=20480-1;i>=0;i--) + { + if(data[i]!=0) return i+1; + } + return 0; + } +}; + +bign a,b,ans; + +char buff[10240]; + +int ConvertSTRtoBIGN_A(const char* incstr,bign& incbign) +{ + int len=strlen(incstr); + for(int i=0;i10) + { + ans.data[i+1]+=ans.data[i]/10; + ans.data[i]=ans.data[i]%10; + } + } + int slen=ans.lenx(); + for(int i=0;i