Advertisement
mikjaer

Untitled

May 14th, 2017
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <regex>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.         string fv;
  9.         regex e ("[,]",std::regex_constants::icase);
  10.  
  11.         cout << "Indtast something, something: ";
  12.         getline (cin, fv);
  13.  
  14.         cout << "Mangeling ...\n\n";
  15.         fv = regex_replace(fv, e, ".");
  16.         float a = atof(fv.c_str());
  17.         cout << "Result:" << a;  
  18.         cout << "\n\n";
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement