#include <fstream>
#include <string>
#include <cctype>
#include <iostream>
// #include <boost/asio.hpp>
#include <sstream>
int main()
{
// ideone.com doesn't link with boost.asio
//   boost::asio::ip::tcp::iostream s("www.google.com", "http");
//   if(!s)
//       std::cout << "Could not connect to www.google.com\n";
//   s << "GET / HTTP/1.0\r\n"
//       << "Host: www.google.com\r\n"
//       << "Accept: */*\r\n"
//       << "Connection: close\r\n\r\n" ;
//

     std::string str = "2+2=4 and other character, including 100%";
     std::istringstream s(str);

// and does not access files
//     std::ofstream out("output.txt");
     for(char c; s.get(c); )
     { 
          if(std::isdigit(c) || c == ',' || c == '-' || c == '%' || c == '.')
               std::cout.put(c);
     }
}