📄 pex10_1.cpp
字号:
#include <iostream.h>
#pragma hdrstop
#include "random.h"
#include "wex10_6.h"
void main(void)
{
int a[10];
RandomNumber rnd;
// fill a with 10 random integers in the range 1..20000
for(int i=0;i < 10;i++)
a[i] = 1 + rnd.Random(20000);
// print the array
for(i=0;i < 10;i++)
cout << a[i] << " ";
cout << endl;
// use arraymax to print the maximum element of a
cout << "The maximum value in the array is "
<< arraymax(a,10) << endl;
}
/*
<Run>
1129 4163 6760 15717 18397 4403 2906 15974 2276 13943
The maximum value in the array is 18397
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -