Pagini recente » Cod sursa (job #1737596) | Cod sursa (job #2203783) | Cod sursa (job #2038011) | Cod sursa (job #464805) | Cod sursa (job #1358399)
# 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;
}