From 06df7f0ac2d7abe8f3d4d0d34da5c93ac05237eb Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Wed, 27 Apr 2016 18:42:37 +0800 Subject: [PATCH] Create 1650.cpp --- QUSTOJ/1650.cpp | 82 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 QUSTOJ/1650.cpp diff --git a/QUSTOJ/1650.cpp b/QUSTOJ/1650.cpp new file mode 100644 index 0000000..7ed0eb3 --- /dev/null +++ b/QUSTOJ/1650.cpp @@ -0,0 +1,82 @@ +#include +#include +#include +using namespace std; + +//Kiritow's BIGN (class BigNumber) Written on Nov. 12th, 2015 +//Original Version: Build 1 +class bign +{ +public: + //WARNING: We use public here to reduce time consumed on Interface, although this is not a recommended way. + int data[3000]; + bool more_than_zero; + bign() + { + more_than_zero=true; + } + void set_empty() + { + memset(data,0,sizeof(int)*3000); + } + int lenx() + { + for(int i=3000-1;i>=0;i--) + { + if(data[i]!=0) return i+1; + } + return 0; + } +}; + +char CompareBIGN(bign& a,bign& b) +{ + int lena=a.lenx(); + int lenb=b.lenx(); + if(lenalenb) + { + return '>'; + } + else + { + for(int i=lena-1;i>=0;i--) + { + if(a.data[i]>b.data[i]) + { + return '>'; + } + else if(a.data[i]