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 +#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; +} 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