该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
}
break;
}
}
int main(int argc, char* argv[])
{
int a[count];
int b[count];
srand( (unsigned)time( NULL ) );
long lNum = 0;
for( int i = 0; i
{
lNum = rand()%count;
if(i%10==0)
printf("\n");
printf( " %6d", lNum );
a[i] = lNum;
b[i] = lNum;
}
printf("\n");
long lStart = GetTickCount();
sort(a,count,1);
long lEnd = GetTickCount();
cout<
for( i = 0; i
{
a[i] = b[i];
}
lStart = GetTickCount();
sort(a,count,2);
lEnd = GetTickCount();
cout<
for( i = 0; i
{
a[i] = b[i];
}
lStart = GetTickCount();
sort(a,count,3);
lEnd = GetTickCount();
cout<
for( i = 0; i
{
a[i] = b[i];
}
lStart = GetTickCount();
sort(a,count,6);
lEnd = GetTickCount();
cout<
for( i = 0; i
{
a[i] = b[i];
}
lStart = GetTickCount();
sort(a,count,5);
lEnd = GetTickCount();
cout<
for( int j = 0; j
{
// if(j%10==0)
// printf("\n");
// printf( " %6d", a[j] );
}
return 0;
}