From cd7d854697563fd054fe3fba57938410643d35fa Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Wed, 27 Apr 2016 18:37:22 +0800 Subject: [PATCH 1/3] Create 1437.cpp --- QUSTOJ/1437.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 QUSTOJ/1437.cpp diff --git a/QUSTOJ/1437.cpp b/QUSTOJ/1437.cpp new file mode 100644 index 0000000..045ad06 --- /dev/null +++ b/QUSTOJ/1437.cpp @@ -0,0 +1,41 @@ +#include +#include +#include +#include + +using namespace std; +class pack +{ +public: + int real; + int absed; + pack(int a):real(a),absed(abs(a)) {} +}; + +bool cmp(const pack& a,const pack& b) +{ + return a.absed>b.absed; +} + +int main() +{ + int n; + while(cin>>n) + { + if(n==0) return 0; + vector bus; + for(int i=0; i>tmp; + bus.push_back(pack(tmp)); + } + sort(bus.begin(),bus.end(),cmp); + for(int i=0; i Date: Wed, 27 Apr 2016 18:37:50 +0800 Subject: [PATCH 2/3] Create 1464.cpp --- QUSTOJ/1464.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 QUSTOJ/1464.cpp diff --git a/QUSTOJ/1464.cpp b/QUSTOJ/1464.cpp new file mode 100644 index 0000000..e125818 --- /dev/null +++ b/QUSTOJ/1464.cpp @@ -0,0 +1,30 @@ +#include +#include +#include +using namespace std; + +char a[1024]; +char b[1024]; + +int main() +{ + while(gets(a)!=NULL) + { + if(strlen(a)<1) + { + continue; + } + int i=0,j=0; + while(a[i]!=0) + { + if(a[i]!=' ') + { + b[j++]=a[i]; + } + ++i; + } + b[j]=0; + puts(b); + } + return 0; +} From ce405c74b33283c927896735da1fb6fd107c944e Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Wed, 27 Apr 2016 18:38:22 +0800 Subject: [PATCH 3/3] Create 1626.cpp --- QUSTOJ/1626.cpp | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 QUSTOJ/1626.cpp diff --git a/QUSTOJ/1626.cpp b/QUSTOJ/1626.cpp new file mode 100644 index 0000000..00b959a --- /dev/null +++ b/QUSTOJ/1626.cpp @@ -0,0 +1,81 @@ +#include +#include +#include +using namespace std; +int data[4]; +char buff[32]; +char cmdline[10240]; +int strlenx(const char* inc) +{ + int i=0; + while(inc[i]!='\0') i++; + return i; +} +//Kiritow's Quick sort function : written on Nov. 2ND ,rewritten on Nov. 10TH +//Updated Version : QuickSort (Build 2) +template +void quicksort(T* a,int left,int right) +{ + if(left>=right) return; + T keyvalue=a[left]; + int i=left,j=right; + while(i=keyvalue) + { + j--; + } + while(i