Skip to content

Instantly share code, notes, and snippets.

@spellancer
Created April 20, 2011 17:43
Show Gist options
  • Save spellancer/932104 to your computer and use it in GitHub Desktop.
Save spellancer/932104 to your computer and use it in GitHub Desktop.
Files lab28
// lab28.cpp: определяет точку входа для консольного приложения.
//Нанян Саркис АК5-21
#include "stdafx.h"
#include <iostream>
#include <set>
#include <fstream>
#include <locale>
#include <string>
#include <algorithm>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
setlocale(0, "russian");
string buf;
// FILE *f , *g ,*h;
int i,j,k,a;
char st[50],s[50],str[10][50];
set<string> fm,gm,hm;
set<string>::iterator it;
ifstream ff;
ifstream gg;
ifstream hh;
ff.open ("f.txt");
while(!ff.eof())
{
ff >> buf;
fm.insert(buf);
}
ff.close ();
gg.open ("g.txt");
while(!gg.eof())
{
gg >> buf;
gm.insert(buf);
}
gg.close ();
//set.iterator lower_bound(int i);
// функция объединения где ffirst должен быть первый элемент множества fm , flast последний , и соответственно gfirst & glast ;
//hm множество объединения
//ошибка
it = set_union (fm.begin() , fm.end() , gm.begin(), gm.end() , hm.begin()) ;
// hh.open ("h.txt");
system ("pause");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment