1
0
This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
42-1st-piscine/ended/C00/ex05/ft_print_comb.c

38 lines
419 B
C
Raw Permalink Normal View History

2023-08-06 20:12:38 +02:00
#include <stdio.h>
#include <unistd.h>
void ft_print_nb(char a, char b, char c)
{
write(1, &a, 1);
write(1, &b, 1);
write(1, &c, 1);
}
void ft_print_comb(void)
{
char a;
char b;
char c;
a = '0';
while (a <= '7')
{
b = a + 1;
while (b <= '8')
{
c = b + 1;
while (c <= '9')
{
ft_print_nb(a, b, c);
if (a != '7')
{
write(1, ", ", 2);
}
c++;
}
b++;
}
a++;
}
}