#include <ctime> //clock,CLOCKS_PER_SEC
#include <iostream>//cin,cout,endl
using namespace std;
int main()
{
double start = clock();
//DO SOMETHING
int a[100];
for (int i = 0; i < 100; i++)
{
a[i] = rand();
cout << a[i];
}
cout << endl;
cout << "花了多少时间?" << endl;
double endtime = clock();
cout << (endtime - start) / CLOCKS_PER_SEC;
int c;
cin >> c;
return 0;
}
经过多次测验,运行时间长度竟然不一样???