Cod sursa(job #1358399)

Utilizator codrut_grosuGrosu Codrut-Cristian codrut_grosu Data 24 februarie 2015 16:32:26
Problema Convertor Scor 0
Compilator cpp Status done
Runda rosedu_cdl_2015 Marime 0.95 kb
# include <iostream>
# include <fstream>
# include <string>
# include <vector>
# include <boost/algorithm/string.hpp>
using namespace boost;

int main () {

	std :: ifstream f ("convertor.in");
	std :: ofstream g ("convertor.out");

	// constante :

	std :: string const paranteza_deschisa ("[");
	std :: string const paranteza_inchisa ("]");
	std :: string const acolada_deschisa ("{");
	std :: string const acolada_inchisa ("}");

	// variabile

	std :: string myWord;
	bool for_ever = true;

	while ( for_ever == true ) {

		std :: getline ( f, myWord );
		std :: size_t pos = myWord.find(paranteza_inchisa);
		if ( pos != std :: string :: npos ) {

			for_ever = false;

		}

		std::vector<std :: string> strs;
		boost :: split(strs, myWord , boost :: is_any_of("\""));
		for ( std :: vector <std :: string> :: iterator it = strs.begin ();
				it != strs.end (); ++it ) {

			g << *it << '\n';

	}

		//g << myWord << '\n';
	}


	f.close ();
	g.close ();
	return 0;
}