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

18
C00/ex00/ft_putchar.c Executable file
View File

@@ -0,0 +1,18 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putchar.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/30 20:24:47 by fgras-ca #+# #+# */
/* Updated: 2022/12/01 17:49:23 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_putchar(char c)
{
write(1, &c, 1);
}

18
C00/ex01/ft_print_alphabet.c Executable file
View File

@@ -0,0 +1,18 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_alphabet.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/30 20:35:41 by fgras-ca #+# #+# */
/* Updated: 2022/12/01 19:28:23 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_print_alphabet(void)
{
write(1, "abcdefghijklmnopqrstuvwxyz", 26);
}

View File

@@ -0,0 +1,18 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_reverse_alphabet.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/01 19:21:48 by fgras-ca #+# #+# */
/* Updated: 2022/12/01 19:27:48 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_print_reverse_alphabet(void)
{
write(1, "zyxwvutsrqponmlkjihgfedcba", 26);
}

18
C00/ex03/ft_print_numbers.c Executable file
View File

@@ -0,0 +1,18 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_numbers.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/01 19:36:44 by fgras-ca #+# #+# */
/* Updated: 2022/12/02 11:52:51 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_print_numbers(void)
{
write(1, "0123456789", 10);
}

25
C00/ex04/ft_is_negative.c Executable file
View File

@@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_is_negative.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/01 19:42:52 by fgras-ca #+# #+# */
/* Updated: 2022/12/02 11:57:31 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_is_negative(int n)
{
if (n < 0)
{
write(1, "N", 1);
}
else
{
write(1, "P", 1);
}
}

BIN
C00/fr.subject .pdf Normal file

Binary file not shown.