Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- /**
- 67 51 18 0 0 24 0 0 48 0 11 0 0
- 18 24 51 11 48 67
- */
- using namespace std;
- ifstream fin("nrnod.in");
- ofstream fout("nrnod.out");
- int v[10001];
- int main()
- {
- int m=0,i,k,cnt=0;
- while(fin>>k)
- {
- v[++m]=k;
- }
- for(i=1;i<=m-2;i++)
- {
- if(v[i]!=0 and v[i+1]==0 and v[i+2]!=0) cnt++;
- if(v[i]==0 and v[i+1]==0 and v[i+2]==0) cnt++;
- }
- fout<<cnt;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement