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