12345678910111213141516
#include <iomanip> #include <iostream> #include <limits> #include <sstream> #include <string> int main() { std::string s = "Price 1=$6.00 Price 2=$5.00 Price 3=$10.00"; std::istringstream ss( s ); double price; while (ss.ignore( std::numeric_limits <std::streamsize> ::max(), '$' ) >> price) { std::cout << std::fixed << std::setprecision(2) << price << "\n"; } }
6.00 5.00 10.00