Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- int main()
- {
- char s[254]="";
- ifstream f;
- ofstream f2;
- f.open("in.txt");
- if (f==NULL)
- {
- cout<<"file no fount :D"<<endl;
- system("PAUSE");
- return EXIT_SUCCESS;
- }
- f2.open("new.txt");
- while (!f.eof())
- {
- f.getline(s, sizeof(s) );
- char *p;
- p=strtok(s," ");
- if (!f.eof())
- f2<<p<<", ";
- else
- f2<<p<<"";
- cout<<p<<" ";
- }
- f.close();
- f2.close();
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement