예제 #1
0
int main() {
    int arr[SIZE_OF_SAMPLES];
    
    srand(9809);  //Seed random number generator.
    
    for (int i = 0; i < REP; i++) {
        UniqRandInt(MAX, SIZE_OF_SAMPLES, arr);
        for(int j = 0; j < SIZE_OF_SAMPLES; j++) {
            std::cout << arr[j] << " ";
        }
        std::cout << std::endl;
    }
    return 0;
}
예제 #2
0
int main(void) {
	int arr[SIZE_OF_SAMPLES], i, j, max, size;

	srand(9809);
	max = MAX;
	size = SIZE_OF_SAMPLES;

	for (i = 0; i < REP; i++) {
		UniqRandInt(max, size, arr);
		for(j = 0; j < size; j++) 
			printf("%d ", arr[i]);
		printf("\n");
	}
	return 0;
}