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