Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- bool email(string dane)
- {
- unsigned size = dane.size();
- for(unsigned i = 0; i < size; ++i)
- if(dane[i] == '@')
- return true;
- return false;
- }
- void selektor()
- {
- string dane;
- ofstream plik;
- plik.open("plik.txt");
- do
- {
- cin >> dane;
- if(email(dane))
- plik << dane << endl;
- } while(dane != "END");
- plik.close();
- }
- int main()
- {
- cout << "Podaj dane osobowe do wczytania: \n";
- selektor();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment