Advertisement
STANAANDREY

sb3 3 bac2020 t19

May 16th, 2022
412
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. ifstream fin("bac.txt");
  5.  
  6. int main() {
  7.     int a = -1, b;
  8.     while (fin >> b) {
  9.         if (a != b && b % 2 == 0) {
  10.             cout << b << ' ';
  11.         }
  12.         a = b;
  13.     }
  14.     return 0;
  15. }
  16.  
Advertisement
RAW Paste Data Copied
Advertisement