Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int impar(int x[], int s, int d)
- {
- if(s==d)
- if(x[s]%2!=0)
- return 1;
- else
- return 0;
- else
- { int m=(s+d)/2;
- return impar(x,s,m)+impar(x,m+1,d);
- }
- }
- int main()
- { int x[100],n,i;
- cin>>n;
- for(i=0;i<n;i++)
- cin>>x[i];
- if(impar(x,0,n-1)>=1)
- cout<<"da";
- else
- cout<<"nu";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement