Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int v[100],k=0,n;
- void f(int li,int ls)
- {
- int lm;
- if(li==ls) {if(v[li]%2==0) k++;}
- else
- {
- lm=(li+lm)/2;
- f(li,lm);
- f(lm+1,ls);
- }
- }
- main()
- {
- int i;
- cin>>n;
- for(i=1;i<=n;i++) cin>>v[i];
- f(1,n);
- cout<<k;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement