Показать сообщение отдельно

  #5  
Старый 11.01.2007, 01:42
sni4ok
Участник форума
Регистрация: 04.11.2006
Сообщений: 150
Провел на форуме:
1174659

Репутация: 175
Отправить сообщение для sni4ok с помощью ICQ
По умолчанию

Код:
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <functional>
#include <algorithm>

using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{

	std::vector<std::string> buf;
	{
		std::ifstream f("123.txt");
		std::copy(std::istream_iterator<std::string>(f),std::istream_iterator<std::string>(),std::back_inserter(buf));
	}

	std::ofstream f("123.txt");
	std::transform(buf.begin(),buf.end(),
		std::ostream_iterator<std::string>(f, "\n"),
		std::bind1st(std::plus<std::string>(), "тест:")
		);

	return 0;
}

Последний раз редактировалось sni4ok; 11.01.2007 в 01:45..
 
Ответить с цитированием