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


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

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


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

    citire(n, v);

    cin >> x;

    cout << sub(n, v, x);

}
close fullscreen
Login or Register to edit or fork this paste. It's free.