首页 > 其他分享 >输入一个固定长度的数组,并输入一个要查找的数,给出能不能检索到的伪代码并测试

输入一个固定长度的数组,并输入一个要查找的数,给出能不能检索到的伪代码并测试

时间:2022-10-09 11:11:41浏览次数:49  
标签:检索 Write item 75 查找 found searchitem 输入

0

60

1

75

2

95

3

80

4

65

5

90

 Length=6             Read in array of values

              Set position to 0

              Weite “enter value for which to search”

              Read searchitem=75

              Set found to true if searchitem is there

              While (position <6)

              IF(found)

                Write “item is found”

                continue

                                                                     ELSE

                                                                   Write ”item is found”

 

                                                                   found Position 1-->75

                                                                   Continue can not found

                                                                     end

 

 


标签:检索,Write,item,75,查找,found,searchitem,输入
From: https://www.cnblogs.com/cjs20030409/p/16771432.html

相关文章