Add ft_print_comb.c
This commit is contained in:
parent
92dc1d827f
commit
7d6aa7b28c
|
@ -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