42/d02/ex04/ft_print_comb.c
2016-11-20 02:20:23 +02:00

49 lines
1.3 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_comb.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/10/27 10:26:03 by gtertysh #+# #+# */
/* Updated: 2016/10/27 11:46:09 by gtertysh ### ########.fr */
/* */
/* ************************************************************************** */
int ft_putchar(char c);
void ft_putnumb(char a, char b, char c)
{
ft_putchar(a);
ft_putchar(b);
ft_putchar(c);
if (!(a == '7' && b == '8' && c == '9'))
{
ft_putchar(',');
ft_putchar(' ');
}
}
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)
{
ft_putnumb(a + '0', b + '0', c + '0');
c++;
}
b++;
}
a++;
}
}