This commit is contained in:
Camille Chauvet
2023-05-17 16:45:25 +00:00
commit 29ed24d567
619 changed files with 16119 additions and 0 deletions

18
C/c00v3/ex00/ft_putchar.c Normal file
View File

@ -0,0 +1,18 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putchar.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/14 13:47:36 by cchauvet #+# #+# */
/* Updated: 2022/07/14 14:39:47 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_putchar(char c)
{
write(1, &c, 1);
}

View File

@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_alphabet.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/14 13:49:41 by cchauvet #+# #+# */
/* Updated: 2022/07/14 14:42:13 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_print_alphabet(void)
{
char a;
a = 'a';
while ('z' >= a)
{
write(1, &a, 1);
a++;
}
}

View File

@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_reverse_alphabet.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/14 13:52:57 by cchauvet #+# #+# */
/* Updated: 2022/07/17 13:07:32 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_print_reverse_alphabet(void)
{
char a;
a = 'z';
while (a >= 'a')
{
write(1, &a, 1);
a--;
}
}

View File

@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_numbers.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/14 13:55:25 by cchauvet #+# #+# */
/* Updated: 2022/07/14 14:45:15 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_print_numbers(void)
{
char a;
a = '0';
while ('9' >= a)
{
write(1, &a, 1);
a++;
}
}

View File

@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_is_negative.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/14 14:14:39 by cchauvet #+# #+# */
/* Updated: 2022/07/16 10:38:55 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_is_negative(int n)
{
char a;
a = 'N';
if (n >= 0)
{
a = 'P';
}
write(1, &a, 1);
}

View File

@ -0,0 +1,54 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_comb.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/14 14:18:48 by cchauvet #+# #+# */
/* Updated: 2022/07/14 15:10:35 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_putchar(char c)
{
write(1, &c, 1);
}
void ft_result(char x, char y, char z)
{
ft_putchar(x);
ft_putchar(y);
ft_putchar(z);
if (!((x == '7') && (y == '8') && (z == '9')))
{
ft_putchar(',');
ft_putchar(' ');
}
}
void ft_print_comb(void)
{
char x;
char y;
char z;
x = '0';
while (x <= '7')
{
y = x + 1;
while (y <= '8')
{
z = y + 1;
while (z <= '9')
{
ft_result(x, y, z);
z++;
}
y++;
}
x++;
}
}

36
C/c00v3/ex07/ft_putnbr.c Normal file
View File

@ -0,0 +1,36 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putnbr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/14 16:46:16 by cchauvet #+# #+# */
/* Updated: 2022/07/14 16:52:22 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_putchar(char a)
{
write(1, &a, 1);
}
void ft_putnbr(int nb)
{
if (nb < 0)
{
ft_putchar('-');
ft_putnbr(-nb);
}
else if (nb > 10)
{
ft_putnbr(nb / 10);
ft_putchar(nb % 10 + 48);
}
else
{
ft_putchar(nb + 48);
}
}