Skip to content
Snippets Groups Projects
utils.c 382 B
Newer Older
LITIERE MALRIC's avatar
TP1
LITIERE MALRIC committed
#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 longeur, size_t N){
    long liste[longeur];
    for(size_t i = 0; i < longeur; i++){
        liste[i] = rand() % N; 
    }
    return liste;  
}