Untitled
raw download clone
CPP
views 43
,
size 601 b
#include <iostream>
using namespace std;


int sub(int n, int v[],int x, int y)
{
    if(n == 0)
        return 0;
    else
        if(v[n - 1] >= x && v[n - 1] < y)
            return 1 + sub(n - 1, v, x, y);
        else
            return sub(n - 1, v, x, y);
}

void citire(int n, int v[])
{
    if(n > 0)
    {
        citire(n - 1, v);
        cin >> v[n - 1];
    }
}


int main ()
{
    int n, v[101], x, y;
    cin >> n;

    citire(n, v);

    cin >> x >> y;

    int z = sub(n, v, x, y);

    cout << z;
    if(z == 0)
        cout << "NU EXISTA";
}
close fullscreen
Login or Register to edit or fork this paste. It's free.