init
This commit is contained in:
19
exam-basedir03/subjects/ft_rrange/subject.en.txt
Normal file
19
exam-basedir03/subjects/ft_rrange/subject.en.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
Assignment name : ft_rrange
|
||||
Expected files : ft_rrange.c
|
||||
Allowed functions: malloc
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Write the following function:
|
||||
|
||||
int *ft_rrange(int start, int end);
|
||||
|
||||
It must allocate (with malloc()) an array of integers, fill it with consecutive
|
||||
values that begin at end and end at start (Including start and end !), then
|
||||
return a pointer to the first value of the array.
|
||||
|
||||
Examples:
|
||||
|
||||
- With (1, 3) you will return an array containing 3, 2 and 1
|
||||
- With (-1, 2) you will return an array containing 2, 1, 0 and -1.
|
||||
- With (0, 0) you will return an array containing 0.
|
||||
- With (0, -3) you will return an array containing -3, -2, -1 and 0.
|
19
exam-basedir03/subjects/ft_rrange/subject.fr.txt
Normal file
19
exam-basedir03/subjects/ft_rrange/subject.fr.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
Assignment name : ft_rrange
|
||||
Expected files : ft_rrange.c
|
||||
Allowed functions: malloc
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Écrire la fonction suivante :
|
||||
|
||||
int *ft_rrange(int start, int end);
|
||||
|
||||
Cette fonction doit allouer avec malloc() un tableau d'ints, le remplir avec
|
||||
les valeurs (consécutives) démarrant à end et finissant à start (start et end
|
||||
inclus !), et renvoyer un pointeur vers la première valeur du tableau.
|
||||
|
||||
Exemples:
|
||||
|
||||
- Avec (1, 3) vous devrez renvoyer un tableau contenant 3, 2 et 1.
|
||||
- Avec (-1, 2) vous devrez renvoyer un tableau contenant 2, 1, 0 et -1.
|
||||
- Avec (0, 0) vous devrez renvoyer un tableau contenant 0.
|
||||
- Avec (0, -3) vous devrez renvoyer un tableau contenant -3, -2, -1 et 0.
|
22
exam-basedir03/subjects/ft_rrange/subject.ro.txt
Normal file
22
exam-basedir03/subjects/ft_rrange/subject.ro.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
Exercitiu : ft_rrange
|
||||
Fisier de iesire : ft_rrange.c
|
||||
Functii autorizate : malloc
|
||||
--------------------------------------------------------------------------------
|
||||
Scrieti functia urmatoare:
|
||||
|
||||
int *ft_rrange(int start, int end);
|
||||
|
||||
Aceasta functie trebuie sa aloce cu ajutorul functiei malloc() un tablou de
|
||||
intregi si sa-l umple valori (consecutive) incepand cu endsi terminand cu start
|
||||
(start si end incluse!), si sa returneze un pointer spre prima valoare a tabloului.
|
||||
|
||||
Exemplu:
|
||||
|
||||
|
||||
Cu parametri (1, 3) trebuie sa returnati un tablou continand valorile 3, 2 si 1.
|
||||
|
||||
Cu parametri (-1, 2) trebuie sa returnati un tablou continand valorile 2, 1, 0 si -1.
|
||||
|
||||
Cu parametri (0, 0) trebuie sa returnati un tablou continand valorile 0.
|
||||
|
||||
Cu parametri (0, -3) trebuie sa returnati un tablou continand valorile -3, -2, -1 si 0.
|
Reference in New Issue
Block a user