All pastes #37219 Raw Edit

Shadow[Of]Death

public cpp v1 · immutable
#37219 ·published 2006-01-18 11:26 UTC
rendered paste body
#include <fstream>#include <iostream>#include <iomanip>#include <string>using namespace std;struct book {	char pav[50];	char author[50];	char klase[50];	int m;	};int Ivedimas() {	book a;	cout << "Knygos pavadinimas" << endl;	cin >> a.pav;	cout << "Knygos autorius" << endl;	cin >> a.author;	cout << "Kokios paskirties knyga, pvz ar tai grozinine literatura ir tt" << endl;	cin >> a.klase;	cout << "Isleidimo metai" << endl;	cin >> a.m;	ofstream fw("Duomenu_baze.txt", ios::app);	fw << a.pav << ' ' << a.author << ' ' << a.klase << ' ' << a.m << endl;	cout << "Duomenys suvesti";	fw.close();	return 0;}int List() {	int b;	char mas[256];	ifstream fr("Duomenu_baze.txt");	while (!fr.eof()) {	    fr.getline(mas, 255);		if (fr) cout << mas << endl;			}	cin >> b;	fr.close();return 1;}int Search() {	string n,d;	int c;	cout << "Iveskite raide kuria prasideda knygos pavadinimas" << endl;	cin >> d;	char mas1[256];	ifstream fr1("Duomenu_baze.txt");	while (!fr1.eof()) {		fr1.getline(mas1, 255);		n =mas1;  if (n == d) if (fr1) cout << mas1 << endl;	}	cin >>c;	fr1.close();	return 1;}Ivedimas();List();Search();void main() {Search();}