-->
当前位置:首页 > 题库

PROGRAMMING:Pointer function code training

Luz5年前 (2021-05-10)题库345
```
Write function
int *find(int a[],int n,int x)
The function is to find the first integer x in the array a with n elements. If it is found, the address of the element will be returned. Otherwise, a null pointer will be returned.
In the main function, input n, then output n integers into the array, then input integer x, and finally output the result of finding X in the array.
```
###Input format:
The first line is the integer n.
Whether the second line contains n integers.
The third line is X.
###Output format:
Output subscript found (starting from 0), output not found not found
###Input example:
```in
ten
1 2 3 4 5 6 7 8 9 10
one
```
###Output example:
```out
0
```
###Input example:
```in
five
5 4 3 2 1
ten
```
###Output example:
```out
NOT FOUND
```







answer:If there is no answer, please comment