53 lines
1.3 KiB
C
53 lines
1.3 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_print_comb.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2026/03/05 09:00:24 by lclerel- #+# #+# */
|
|
/* Updated: 2026/03/06 10:56:51 by lclerel- ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include <unistd.h>
|
|
|
|
void print(char a, char b, char c)
|
|
{
|
|
write(1, &a, 1);
|
|
write(1, &b, 1);
|
|
write(1, &c, 1);
|
|
if (!(a == '7' && b == '8' && c == '9'))
|
|
write(1, ", ", 2);
|
|
}
|
|
|
|
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')
|
|
{
|
|
print(a, b, c);
|
|
c++;
|
|
}
|
|
b++;
|
|
}
|
|
a++;
|
|
}
|
|
}
|
|
|
|
/*int main(void)
|
|
{
|
|
ft_print_comb();
|
|
return (0);
|
|
}*/
|