Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- using namespace std;
- int main()
- {
- fstream zadanie4, napisy;
- int parzyste=0, ilosc_znakow;
- string tekst;
- zadanie4.open("zadanie4.txt",ios::out);
- napisy.open("napisy.txt",ios::in);
- if(napisy.good())
- {
- cout << "uzyskano dostep" << endl;
- while(napisy.good())
- {
- getline(napisy, tekst);
- ilosc_znakow=tekst.size();
- if (ilosc_znakow%2==0) parzyste++;
- }
- zadanie4 << "a) liczba parzystych wpisow wynosi: "<< parzyste <<endl;
- }
- else cout << "Blad!";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement