Advertisement
STANAANDREY

BAC var3

Feb 18th, 2019
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. ifstream f("BAC.txt");
  5. int main()
  6. {
  7. long long x,nr=0,cont=0,k=0;
  8.  
  9. while (f>>x && x%2!=0)
  10. {
  11.    nr++;}
  12.    k=nr+1;
  13.  while (f>>x)
  14.    { k++;
  15.       if(x%2==0) cont=0;
  16.       else cont++;
  17.    }
  18.  
  19. cout<<k-(nr+cont);
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement