建议代码:
using namespace std;
int main(int argc, char* argv[]) {
srand(time(0));
const int array_size = 200000; // 1
int a[array_size];
for (int counter = 0; counter < array_size; counter++) { // 2
a[counter] = rand() % 50 - rand() % 50; // 3
cout << a[counter] << " ";
}
int min = a[0]; // 4
for (int counter = 1; counter < array_size; counter++) { // 5
if (min > a[counter]) {
min = a[counter]; // 6
}
}
cout << "\nmin = " << min << endl;
cout << "runtime = " << clock() / 1000.0 << endl;
system("pause");
return 0;
}
我得到以下信息:
不过,我并不完全确定,因为……就霍尔斯特德度量而言,过程和函数名称是运算符,函数是操作数,我无法弄清楚给定程序中什么是函数以及什么是函数名称。

根据霍尔斯特德度量:
n1为唯一程序语句的数量,包括分隔符、过程名和操作符号(语句字典);
n2 是唯一程序操作数(操作数字典)的数量。
我们还定义一下术语:
操作数是运算的参数。
举个例子:加法运算中的操作数a和b:a + b。
运算符- 对操作数的操作(命令)。
举个例子:运算符 sum(a,b)
例如:
这里
另一个例子:
这里:
您的案例示例:
这里:
其余代码也是如此。