#include using namespace std; bool appartiene(int A[],int inizio,int n,int x) { if (inizio == n) return false; else if (A[inizio] == x) return true; else return appartiene(A,inizio+1,n,x); } bool appartiene(int A[],int n,int x) { appartiene(A,0,n,x); } int main() {int V[5] = {3,4,1,2,8}; if (appartiene(V,5,1)) cout << "OK" << endl; else cout << "NO" << endl; system("pause"); return 0; }