Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- int main (void)
- {
- ifstream f("f.txt");
- ofstream g("g.txt");
- ofstream h("h.txt");
- int a;
- while (f >> a)
- {
- if (a%2==0)
- g << a << " ";
- else h << a << " ";
- }
- f.close();
- g.close();
- h.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment