Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- int main() {
- ifstream f;
- f.open("input.txt", ios::in);
- string s;
- while (getline(f, s)) {
- for (size_t i = 0; i < s.size(); ++i) {
- if(isdigit(s[i])) {
- cout << s[i];
- } else if (s[i] == ' ') {
- cout << " ";
- }
- }
- cout << " ";
- }
- f.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement