g*******g 发帖数: 431 | 1 Write a C++ function prototype and a function definition called minimum that
receives an array of type double, and the number of elements in the array.
It returns the minimum value in the array.
#include
#include
using namespace std;
void minimum ();
int main()
{
minimum();
return 0;
}
{
char str[];
double arr[];
int min_value, num, i;
//get array from console
cout<<"Enter a string:";
cin>>str;
//find number of element in the array
num = sizeof (str)/sizeof([str]);
//find min |
g*******g 发帖数: 431 | 2 求人帮忙看下这个程序
main function 一定要有变量吗 可不可以直接调用minimum function?
我什么都不知道我有理!!! |
h*****0 发帖数: 4889 | 3 "a function definition called minimum that receives an array
of type double, and the number of elements in the array."
这段话读一百遍……
【在 g*******g 的大作中提到】 : 求人帮忙看下这个程序 : main function 一定要有变量吗 可不可以直接调用minimum function? : 我什么都不知道我有理!!!
|
g*******g 发帖数: 431 | 4
恩,我也没看懂,别人给出的题。我理解或是一个给定的一个已知size的数组,或是随
便从界面输入的数组,需要自己计算出数组的size。我这个是按第二种理解编的。。
【在 h*****0 的大作中提到】 : "a function definition called minimum that receives an array : of type double, and the number of elements in the array." : 这段话读一百遍……
|
B*******g 发帖数: 1593 | 5 我怎么觉着按题目意思这个minimum的prototype应该是
double minimum(double *,int)
that
array.
【在 g*******g 的大作中提到】 : Write a C++ function prototype and a function definition called minimum that : receives an array of type double, and the number of elements in the array. : It returns the minimum value in the array. : #include : #include : using namespace std; : void minimum (); : int main() : { : minimum();
|
g*******g 发帖数: 431 | 6
double minimum(double *,int)?
(double *,int)是什么意思?
【在 B*******g 的大作中提到】 : 我怎么觉着按题目意思这个minimum的prototype应该是 : double minimum(double *,int) : : that : array.
|
s**h 发帖数: 1889 | 7 第一个参数是数组,第二个是数组大小
【在 g*******g 的大作中提到】 : : double minimum(double *,int)? : (double *,int)是什么意思?
|
t****t 发帖数: 6806 | 8 不是你"也"没看懂, 是只有你没看懂. 别人叫你读100遍, 是叫你把题看懂了再来. 人
的语言都没学好, 就不要想着学计算机语言了.
【在 g*******g 的大作中提到】 : : double minimum(double *,int)? : (double *,int)是什么意思?
|
d****p 发帖数: 685 | 9 表这样凶嘛:我感觉这位是女生.
【在 t****t 的大作中提到】 : 不是你"也"没看懂, 是只有你没看懂. 别人叫你读100遍, 是叫你把题看懂了再来. 人 : 的语言都没学好, 就不要想着学计算机语言了.
|
z***9 发帖数: 696 | |