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]