Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- string konwertuj(string napis) // funkcja, ktΓ³ra pozostawia w wyrazie same maΕe litery
- {
- }
- int main()
- {
- ifstream plik;
- plik.open("hamlet.txt");
- if(plik.good())
- cout << "Podaj wyraz: " << endl;
- else
- {
- cout << "Nie udalo sie otworzyc pliku" << endl;
- return 0;
- }
- string wczytywany, podany;
- cin >> podany;
- unsigned licznik = 0;
- while(plik >> wczytywany)
- if(wczytywany == podany)
- ++licznik;
- plik.close();
- cout << licznik << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement