Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main() {
- std::ifstream fin("C:\\Users\\Nyanwitt\\Documents\\Visual Studio 2015\\Projects\\lol\\lol.txt");
- std::istream_iterator<int> in(fin), eof;
- while (in != eof) {
- if (*in % 2 == 0) {
- std::ofstream fout("even.txt");
- std::ostream_iterator<int> out(fout, "\n");
- out = *in;
- }
- else {
- std::ofstream fout2("odd.txt");
- std::ostream_iterator<int> out2(fout2, "\n");
- out2 = *in;
- };
- in++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement