Compare commits
3 Commits
a54b12d58e
...
7d6aa7b28c
| Author | SHA1 | Date |
|---|---|---|
|
|
7d6aa7b28c | |
|
|
92dc1d827f | |
|
|
18df1442cc |
|
|
@ -0,0 +1,33 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_print_reverse_alphabet.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/03/15 21:50:37 by tischmid #+# #+# */
|
||||
/* Updated: 2023/03/16 05:00:01 by tischmid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_print_numbers(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = '0';
|
||||
while (i <= '9')
|
||||
{
|
||||
write(1, &i, 1);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
/* ////
|
||||
int main(void)
|
||||
{
|
||||
ft_print_numbers();
|
||||
return (0);
|
||||
}
|
||||
*/ ////
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_print_reverse_alphabet.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/03/15 21:50:37 by tischmid #+# #+# */
|
||||
/* Updated: 2023/03/16 05:00:01 by tischmid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_is_negative(int n)
|
||||
{
|
||||
if (n < 0)
|
||||
{
|
||||
write(1, "N", 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
write(1, "P", 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* ////
|
||||
int main(void)
|
||||
{
|
||||
ft_is_negative(5);
|
||||
ft_is_negative(0);
|
||||
ft_is_negative(-5);
|
||||
return (0);
|
||||
}
|
||||
*/ ////
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_print_reverse_alphabet.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/03/15 21:50:37 by tischmid #+# #+# */
|
||||
/* Updated: 2023/03/16 05:00:01 by tischmid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_print_comb(void)
|
||||
{
|
||||
int a;
|
||||
int b;
|
||||
int c;
|
||||
|
||||
a = '0';
|
||||
while (a <= '7')
|
||||
{
|
||||
b = a + 1;
|
||||
while (b <= '8')
|
||||
{
|
||||
c = b + 1;
|
||||
while (c <= '9')
|
||||
{
|
||||
write(1, &a, 1);
|
||||
write(1, &b, 1);
|
||||
write(1, &c, 1);
|
||||
if (a != '7')
|
||||
{
|
||||
write(1, ", ", 2);
|
||||
}
|
||||
c++;
|
||||
}
|
||||
b++;
|
||||
}
|
||||
a++;
|
||||
}
|
||||
}
|
||||
|
||||
/* ////
|
||||
int main(void)
|
||||
{
|
||||
ft_print_comb();
|
||||
return (0);
|
||||
}
|
||||
*/ ////
|
||||
Loading…
Reference in New Issue