1796: 【CSP数组】数组元素的查找▅
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:6
Solved:5
Description
给你 m 个整数,查找其中有无值为 n 的数,有则输出该数第一次出现的位置,没有则输出 −1 。
Input
第一行一个整数 m 代表数的个数 ( 0≤m≤100 ) 。
第二行 m 个整数(空格隔开)( 这些数在0∼1000000范围内 )。
第三行为要查找的数 n。
Output
n 的位置或 −1。
Sample Input Copy
4
1 2 6 6
6
Sample Output Copy
3