Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- using namespace std;
- int main()
- {
- int parzyste, liczba_znakow;
- string tekst;
- parzyste=0;
- ifstream dane("napisy.txt");
- ofstream odpowiedz;
- odpowiedz.open("zadanie4e.txt");
- if (dane.is_open())
- {
- while(dane.good())
- {
- getline(dane, tekst);
- liczba_znakow=tekst.size();
- if (liczba_znakow%2==0) parzyste++;
- }
- odpowiedz << "liczba parzystych wpisow wynosi "<< parzyste << "\n";
- }
- else cout << "\nBlad otwarcia pliku\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement