Seal_of_approval

2p56

Dec 7th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3. int main (void)
  4. {
  5. ifstream f("f.txt");
  6. ofstream g("g.txt");
  7. ofstream h("h.txt");
  8. int a;
  9. while (f >> a)
  10. {
  11. if (a%2==0)
  12. g << a << " ";
  13. else h << a << " ";
  14. }
  15. f.close();
  16. g.close();
  17. h.close();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment