Write a function generating 40 random integers of an array which are less than ‘xMax’.Write a function calculating the sum of elements in the array.The main function should allow the user to enter value of ‘xMax’,call the calculating function
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 15:45:15
Write a function generating 40 random integers of an array which are less than ‘xMax’.Write a function calculating the sum of elements in the array.The main function should allow the user to enter value of ‘xMax’,call the calculating function
Write a function generating 40 random integers of an array which are less than ‘xMax’.
Write a function calculating the sum of elements in the array.
The main function should allow the user to enter value of ‘xMax’,call the calculating function from above and output the calculated sum to the screen.
Write a function generating 40 random integers of an array which are less than ‘xMax’.Write a function calculating the sum of elements in the array.The main function should allow the user to enter value of ‘xMax’,call the calculating function
#include "stdafx.h"
#include
using namespace std;
#define ARRAY_ELEMNET_NUMBER 40
int GenerateArrayAndCalculateSum(int);
int _tmain(int argc,_TCHAR* argv[])
{
\x05int xMax;
\x05cout