POJ1706 References

//6_1_1: References 参考文献的整理 POJ1706#include #include #include using namespace std;const int maxl = 80 + 5; //一行最长为80个字符const int maxs = 240 + 10; //参考文献不超过3行const int maxr = 1000; //参考文献最多设置10
摘要由CSDN通过智能技术生成
//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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值