Piscine42

This commit is contained in:
2023-12-12 17:25:55 +01:00
commit e07184f084
62 changed files with 1572 additions and 0 deletions

16
C01/ex00/ft_ft.c Executable file
View File

@@ -0,0 +1,16 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_ft.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/03 18:27:18 by fgras-ca #+# #+# */
/* Updated: 2022/12/05 15:43:03 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
void ft_ft(int *nbr)
{
*nbr = 42;
}

16
C01/ex01/ft_ultimate_ft.c Executable file
View File

@@ -0,0 +1,16 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_ultimate_ft.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/05 15:48:06 by fgras-ca #+# #+# */
/* Updated: 2022/12/08 10:13:16 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
void ft_ultimate_ft(int *********nbr)
{
*********nbr = 42;
}

20
C01/ex02/ft_swap.c Executable file
View File

@@ -0,0 +1,20 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_swap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/05 15:50:26 by fgras-ca #+# #+# */
/* Updated: 2022/12/05 15:54:58 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
void ft_swap(int *a, int *b)
{
int swap;
swap = *a;
*a = *b;
*b = swap;
}

17
C01/ex03/ft_div_mod.c Executable file
View File

@@ -0,0 +1,17 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_div_mod.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/05 15:57:30 by fgras-ca #+# #+# */
/* Updated: 2022/12/07 09:17:14 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
void ft_div_mod(int a, int b, int *div, int *mod)
{
*div = a / b;
*mod = a % b;
}

20
C01/ex04/ft_ultimate_div_mod.c Executable file
View File

@@ -0,0 +1,20 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_ultimate_div_mod.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/06 16:55:09 by fgras-ca #+# #+# */
/* Updated: 2022/12/07 09:50:31 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
void ft_ultimate_div_mod(int *a, int *b)
{
int swap;
swap = *a;
*a = swap / *b;
*b = swap % *b;
}

25
C01/ex05/ft_putstr.c Executable file
View File

@@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/06 17:08:21 by fgras-ca #+# #+# */
/* Updated: 2022/12/07 12:42:16 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_putstr(char *str)
{
int a;
a = 0;
while (str[a] != '\0')
{
write(1, &str[a], 1);
a++;
}
}

23
C01/ex06/ft_strlen.c Executable file
View File

@@ -0,0 +1,23 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/07 11:01:26 by fgras-ca #+# #+# */
/* Updated: 2022/12/07 12:40:42 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
int ft_strlen(char *str)
{
int a;
a = 0;
while (str[a] != '\0')
{
a++;
}
return (a);
}

BIN
C01/fr.subject.pdf Normal file

Binary file not shown.