Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #define ins in
- #define outs cout
- using namespace std;
- int main()
- {
- ifstream in("input.txt");
- ofstream out("output.txt");
- string t;
- getline(ins, t);
- double d;
- size_t cnt;
- while (t.length() > 0)
- {
- try
- {
- d = stod(t, &cnt);
- outs << d << " ";
- t.erase(0, cnt);
- }
- catch (...)
- {
- t.erase(0, 1);
- }
- }
- getc(stdin);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement