vertc

09-01

Jan 9th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. main () {
  7.     ifstream we("dane1.txt");
  8.     ofstream wew("wynik1.txt");
  9.     string s;
  10.     while(!we.eof()) {
  11.         we>>s;
  12.         if(s.size()%2==0) {
  13.             wew<<s<<endl;
  14.         }
  15.     }
  16.     we.close();
  17.     wew.close();
  18.     return 0;
  19. }
  20.  
  21. -------------------------------------------------------------------------------------
  22.  
  23. #include <iostream>
  24. #include <fstream>
  25.  
  26. using namespace std;
  27.  
  28. main () {
  29.     ofstream plik;
  30.     plik.open("dane.txt");
  31.     for (int i=0;i<9;i++)
  32.     plik<<i<<endl;
  33.     plik.close();
  34.     plik.open("dane.txt");
  35.     int a=5,b=4,c=3;
  36.     plik<<a<<"\n"<<b<<endl<<c<<endl;
  37.     plik<<endl<<++a;
  38.     plik.close();
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment