[CODE]#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int random(int low,int high){
int range = high-low+1;
return low+rand()%range;
}
void swap(int &a,int &b){
int t = a;
a = b;
b = t;
}
int main(){
srand((unsigned)time(0));
int a[100],i,j;
for (i = 0;i < 100;++i)
a[i] = i+1;
for (i = 0;i < 100;++i){
j = random(i,100);
if (i != j)
swap(a[i],a[j]);
}
for (i = 0 ;i < 100;++i)
cout << a[i] << " ";
cout << endl;
system("pause");
}[/CODE]
#include <ctime>
#include <cstdlib>
using namespace std;
int random(int low,int high){
int range = high-low+1;
return low+rand()%range;
}
void swap(int &a,int &b){
int t = a;
a = b;
b = t;
}
int main(){
srand((unsigned)time(0));
int a[100],i,j;
for (i = 0;i < 100;++i)
a[i] = i+1;
for (i = 0;i < 100;++i){
j = random(i,100);
if (i != j)
swap(a[i],a[j]);
}
for (i = 0 ;i < 100;++i)
cout << a[i] << " ";
cout << endl;
system("pause");
}[/CODE]
Fight to win or die...