#include
<
iostream
>
#include < stdlib.h >
int main()
{
int i, N = 100;
int *a = new int[N];
for(i=0; i<N; i++)
{
a[i] = 1000 * (1.0 * rand()/RAND_MAX);
std::cout << a[i] << " ";
}
std::cout << std::endl << std::endl;
Sort(a, 0, N-1);
for(i=0; i<N; i++)
std::cout << a[i] << " ";
std::cout << std::endl;
std::cin >> i;
}
#include < stdlib.h >
int main()
{
int i, N = 100;
int *a = new int[N];
for(i=0; i<N; i++)
{
a[i] = 1000 * (1.0 * rand()/RAND_MAX);
std::cout << a[i] << " ";
}
std::cout << std::endl << std::endl;
Sort(a, 0, N-1);
for(i=0; i<N; i++)
std::cout << a[i] << " ";
std::cout << std::endl;
std::cin >> i;
}
另有VB.net版本演示程序:http://www.cnblogs.com/maweifeng/archive/2005/03/22/123594.html
所有评论(0)