Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- void wyliczanie() {
- ifstream plik("liczby_bin.txt");
- string wiersz;
- auto licznik{ 1 };
- while (plik >> wiersz) {
- if (wiersz.front() == wiersz.back()) {
- cout << licznik++ << ". " << wiersz << endl;
- }
- }
- plik.close();
- }
- int main() {
- wyliczanie();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment