Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- main () {
- ifstream we("dane1.txt");
- ofstream wew("wynik1.txt");
- string s;
- while(!we.eof()) {
- we>>s;
- if(s.size()%2==0) {
- wew<<s<<endl;
- }
- }
- we.close();
- wew.close();
- return 0;
- }
- -------------------------------------------------------------------------------------
- #include <iostream>
- #include <fstream>
- using namespace std;
- main () {
- ofstream plik;
- plik.open("dane.txt");
- for (int i=0;i<9;i++)
- plik<<i<<endl;
- plik.close();
- plik.open("dane.txt");
- int a=5,b=4,c=3;
- plik<<a<<"\n"<<b<<endl<<c<<endl;
- plik<<endl<<++a;
- plik.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment