查找某一个数
Description
輸入一個從小到大排列的有序數列(長度小于100),在此數列中查找某一個數x,若找到,輸出相應下標,否則,輸出”Not Found".
Input
先輸入要查找的數x和n, 再輸入n個有序數。
Output
輸出x所在位置下標或"Not Found"
Sample Input
2 8 -2 2 3 8 9 20 25 67
5 7 -2 2 3 8 9 20 25
Sample Output
1
Not Found
總結
Description
輸入一個從小到大排列的有序數列(長度小于100),在此數列中查找某一個數x,若找到,輸出相應下標,否則,輸出”Not Found".
Input
先輸入要查找的數x和n, 再輸入n個有序數。
Output
輸出x所在位置下標或"Not Found"
Sample Input
2 8 -2 2 3 8 9 20 25 67
5 7 -2 2 3 8 9 20 25
Sample Output
1
Not Found