Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
84
Добавлен:
10.12.2013
Размер:
1.86 Кб
Скачать
#ifndef CLASS
#define CLASS
#include <iostream>
#include <stack>
#include <vector>
#include <fstream>
#include <algorithm>
#include <string>
using namespace std;
//-----------------------------------------------------------------------
class BIBL
{
	string autor;
	string name;
	float price;
public:
	BIBL ();
	BIBL (string,string,float);
	BIBL (const BIBL&);
	string GetAutor();
	int GetPrice();
	void Input();
	void Show();
	friend istream& operator>>(istream&,BIBL&);
	friend ostream& operator<<(ostream&,BIBL&);
	BIBL& operator = (const BIBL&);
	bool operator ==(const BIBL&);
	bool operator < (const BIBL&);
};
//-----------------------------------------------------------------------
class comp_grater
{
public:
	bool operator()(BIBL& b1,BIBL& b2)
	{
		if(b1<b2) return false;
		else return true;
	}
};
//-----------------------------------------------------------------------
class comp_autor
{
	string s;
public:
	comp_autor(string S){s=S;}
	bool operator()(BIBL& b)
	{
		if(b.GetAutor() == s) return true;
		else return false;
	}
};
//-----------------------------------------------------------------------
class comp_price
{
	int t;
public:
	comp_price(int T){t=T;}
	bool operator()(BIBL& b)
	{
		if(b.GetPrice()>t) return  true;
		else return false;
	}
};
//-----------------------------------------------------------------------
typedef deque<BIBL> db;
typedef stack<BIBL> sb;
typedef db::iterator iter;
//-----------------------------------------------------------------------
void Remove_copy_if(db&,sb&,comp_price);
void PrintDeque(string,db);
void PrintStack(string,sb);
void Sort(sb&);
string Rus(string );
void AddOfFile(ifstream&,db&);
void FindAutor(db,string);
db Merge(db&,sb&);
//-----------------------------------------------------------------------
#endif 
Соседние файлы в папке Prog3