MeehoweCK

Untitled

Jun 4th, 2024
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. void wyliczanie() {
  7.     ifstream plik("liczby_bin.txt");
  8.     string wiersz;
  9.     auto licznik{ 1 };
  10.     while (plik >> wiersz) {
  11.         if (wiersz.front() == wiersz.back()) {
  12.             cout << licznik++ << ". " << wiersz << endl;
  13.         }
  14.     }
  15.     plik.close();
  16. }
  17.  
  18. int main() {
  19.     wyliczanie();
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment