请帮帮我 [英] Please help me in this

查看:60
本文介绍了请帮帮我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编写一个程序,它将定义一个大小为10的整数数组test []。

程序将通过键盘将数值读入数组test []中。

来自用户。在读入数组测试[]后,程序将提示用户输入要搜索的值:。作为回应,

用户将通过键盘输入一个值,程序将以整数变量值存储值。然后程序将

数组test []和变量值传递给函数find()。函数

find()将在数组test []中搜索给定的元素值。如果找到

元素,则会显示消息找到元素并且

位置。如果找不到该元素,则返回

消息未找到该元素。被展示。结果是在find()函数中显示



提示

·有一个整数变量值和一个数组test [] of大小10.

·通过引用将数组传递给find()函数,但是按值传递

变量值。

·函数find()接受两个参数(即整数数组和

整数变量值)但不返回任何值(即无效)。

样本输出


在数组中输入值

17

21

34

31

44

23

78

21

66

35

输入要搜索的值:23

元素被找到且位置为6


在数组中输入值

29

22

36

30

54

63

78

21

26

85

输入一个值被搜查:23

找不到元素。

解决方案

na *** *******@gmail.com 写道:

编写一个程序,定义一个大小为10的整数数组[]。
程序将通过键盘从用户读取值到数组test []。在读入阵列测试[]之后,程序将提示用户输入要搜索的值:。作为回应,用户将通过键盘输入值,程序将值存储在整数变量值中。然后程序将
数组test []和变量值传递给函数find()。函数
find()将在数组test []中搜索给定的元素值。如果找到
元素,则显示消息找到元素并且
位置是。如果未找到该元素,则会显示未找到该元素的消息。被展示。结果显示在find()函数中。

提示
?有一个整数变量值和一个大小为10的数组test [
?·通过引用将数组传递给find()函数,但是按值传递
变量值。
?函数find()接受两个参数(即整数数组和
整数变量值)但不返回任何值(即无效)。

样本输出

在数组中输入值
17
21
34
31
44
78
21
66
输入要搜索的值:23 元素被找到,位置是6
g输入值到数组中
29
22
36
54
输入要搜索的值:23
找不到该元素。

< br $>

给我一笔合理的费用,我会为你做功课。


但如果我这样做是为了这么懒的pe你似乎很好,你永远不会花b $ b学习任何东西 - 除了如何将你的作业问题复制到

新闻组。


为什么你不至少尝试做某事,即使你的编程技巧是非常基本的,如果你遇到麻烦,也可以在这里发布代码。然后我们

可以试着帮助你。


你永远不会知道,你甚至可以学到一些东西:D


Alan




< na ********** @ gmail.com>在消息中写道

news:11 ********************** @ j73g2000cwa.googlegr oups.com ...

Re:请帮我这个
写一个程序




....等


当然我们会帮助您完成您的计划,但是我们需要看到它们。你还需要告诉我们

你遇到了什么问题(例如编译器

错误,程序行为超出预期等等)

>
-Mike


blockquote>

Mike Wahler写道:


< NA ********** @ gmail.com>在消息中写道
新闻:11 ********************** @ j73g2000cwa.googlegr oups.com ......

Re:请帮我这个


编写一个程序



......等

当然,我们会帮助您完成您的计划,但我们需要看到它。你还需要告诉我们你遇到了什么问题(例如编译器错误,程序行为超出预期等等)

-Mike




问题是,迈克,让我们看看他的程序,他首先必须写它!!


你也用编译器这个词;没有向他解释什么是

编译器。


他可能最好将他的课程改为针线或针织


Alan


Write a program that will define an integer array test[] of size 10.
The program will read values into the array test[] through keyboard
from the user. After reading into the array test[] the program will
prompt the user to "Enter a value to be searched:". In response,
the user will enter a value through keyboard and the program will store
the value in an integer variable value. The program will then pass the
array test[] and the variable value to a function find(). The function
find() will search the array test[] for the given element value. If the
element was found then a message "The element was found and the
location is "is displayed. If the element was not found then a
message "The element was not found." is displayed. The result is
displayed in the find() function.
Hints
· There is an integer variable value and an array test[] of size 10.
· Pass the array to the find() function by reference but pass the
variable value by value.
· The function find() takes two parameters (i.e. an integer array and
an integer variable value) but returns no value (i.e. void).
Sample Output

Enter values into array
17
21
34
31
44
23
78
21
66
35
Enter a value to be searched: 23
The element was found and the location is 6

Enter values into array
29
22
36
30
54
63
78
21
26
85
Enter a value to be searched: 23
The element was not found.

解决方案

na**********@gmail.com wrote:

Write a program that will define an integer array test[] of size 10.
The program will read values into the array test[] through keyboard
from the user. After reading into the array test[] the program will
prompt the user to "Enter a value to be searched:". In response,
the user will enter a value through keyboard and the program will store
the value in an integer variable value. The program will then pass the
array test[] and the variable value to a function find(). The function
find() will search the array test[] for the given element value. If the
element was found then a message "The element was found and the
location is "is displayed. If the element was not found then a
message "The element was not found." is displayed. The result is
displayed in the find() function.
Hints
?· There is an integer variable value and an array test[] of size 10.
?· Pass the array to the find() function by reference but pass the
variable value by value.
?· The function find() takes two parameters (i.e. an integer array and
an integer variable value) but returns no value (i.e. void).
Sample Output

Enter values into array
17
21
34
31
44
23
78
21
66
35
Enter a value to be searched: 23
The element was found and the location is 6
g
Enter values into array
29
22
36
30
54
63
78
21
26
85
Enter a value to be searched: 23
The element was not found.



Send me a reasonable fee and I will do your homework for you.

But if I did that for such a lazy person as you seem to be, you would NEVER
learn anything - except how to copy your homework question into a
newsgroup.

Why don''t you at least try to do something, even if your programming skills
are very basic, and post the code here if you get into trouble. Then we
can try to help you.

You never know, you may even learn something :D

Alan



<na**********@gmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...

Re: Please help me in this Write a program that will



.... etc.

Sure we''ll help you with your program, but
we need to see it. You also need to tell us
what problems you''re having (e.g. compiler
errors, program behaves other than expected, etc.)

-Mike



Mike Wahler wrote:


<na**********@gmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...

Re: Please help me in this


Write a program that will



... etc.

Sure we''ll help you with your program, but
we need to see it. You also need to tell us
what problems you''re having (e.g. compiler
errors, program behaves other than expected, etc.)

-Mike



Problem is, Mike, for us to see his program he first has to write it!!

Also you use the word "compiler" without explaining to him just what a
compiler is.

He is probably better off changing his course to Needlework or Knitting

Alan


这篇关于请帮帮我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆