Skip to content
Snippets Groups Projects
Forked from GOSSA JULIEN / P4z
4 commits behind, 17 commits ahead of the upstream repository.
utils.c 411 B
#include <stdio.h>
#include <stdlib.h>
#include "utils.h"

void affichertab(long* T, int s){
    printf("[ ");
    for(int i = 0; i < s-1; i++){
        printf("%d , ",T[i]);
    }
    printf("%d ]\n",T[s-1]);
}

long* listeAlea(size_t longueur, size_t N){
    long* liste = malloc(sizeof(long) * longueur);
    for(size_t i = 0; i < longueur; i++){
        liste[i] = rand() % N; 
    }

    return liste;  
}