//6_1_1: References 参考文献的整理 POJ1706
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int maxl = 80 + 5; //一行最长为80个字符
const int maxs = 240 + 10; //参考文献不超过3行
const int maxr = 1000; //参考文献最多设置1000条
struct reference
{
char info[maxs];
int old_num,new_num;
}ref[maxr];
bool isEmpty(char str[])
{
int i = 0;
while(str[i]) if(str[i ++] != ' ') return false;
return true;
}
void quick_sort(int st,int ed) //快排算法
{
int i = st,j = ed;
reference temp;
if(st < ed)
{
temp = ref[st];
while(i != j)
{
while(j > i && ref[j].new_num >= temp.new_num) j--;
ref[i] = ref[j];
while(i < j && ref[i].new_num <= temp.new_num) i++;
ref[j] = ref[i];
}
ref[i] = temp;
quick_sort(st,i - 1);
quick_sort(i + 1,ed);
}
}
int main()
{
char str[maxl],info[maxs];
int i,j,old_num,ref_n
POJ1706 References
最新推荐文章于 2016-10-11 19:31:34 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)