Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream fin("nrnod.in");
- ofstream fout("nrnod.out");
- int a[100000], sol;
- int main()
- {
- int i = 2;
- while(fin >> a[i])
- {
- if((a[i] != 0 && a[i - 1] == 0 && a[i - 2] != 0) || (a[i] == 0 && a[i - 1] == 0 && a[i - 2] == 0)) sol++;
- i++;
- }
- fout << sol;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement