Advertisement
Guest User

zad1

a guest
May 25th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include<fstream>
  3. #include<string.h>
  4. using namespace std;
  5.  
  6. int main(){
  7. ifstream elo1("1.txt");
  8. ifstream elo2("2.txt");
  9. ofstream wyjscie("3.txt");
  10.  
  11. do {
  12.     string linia;
  13.     if(getline(elo1,linia )){
  14.         wyjscie<<linia << " ";
  15.  
  16.     }
  17.     if(getline(elo2,linia )){
  18.             wyjscie<<linia;
  19.  
  20.     }
  21.     wyjscie<<endl;
  22.  
  23. }while(elo1 || elo2);
  24. wyjscie.close();
  25. elo1.close();
  26. elo2.close();
  27.  
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement