на С++ как то так
#include
#include
using namespace std;
int main(){
srand(time(NULL));
int N, a, sum = 0, ten = 10, index = 0;
int *arr;
cout << "enter size of arr(enter N) : ";<br> cin >> N;
arr = new int [N];
for(int i = 1; i <= N;i++)<br> arr[i] = rand()%25;
cout << "arr : " << endl;<br> for(int i = 1; i <= N;i++)<br> cout << arr[i] << " " ;<br> cout << endl;</p>
cout << "enter a : " ;<br> cin >> a;
for(int i = 1; i <= N;i++)<br> {
if(arr[i] == a)
index = i;
}
if(index != 0)
{
for(int i = index + 1; i <= N;i++)<br> sum = sum + arr[i];
}
if(sum == 0)
cout << "Result = " << ten << endl; <br> else
cout << "Result = " << sum << endl; <br>}