-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_print_comb.c
48 lines (44 loc) · 1.27 KB
/
ft_print_comb.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_comb.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nkuzminy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/18 12:11:55 by nkuzminy #+# #+# */
/* Updated: 2022/07/18 13:07:04 by nkuzminy ### ########.fr */
/* */
/* ************************************************************************** */
#include<unistd.h>
void ft_putchar(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 d;
char e;
char f;
d = '0';
while (d <= '7')
{
e = d + 1;
while (e <= '8')
{
f = e + 1;
while (f <= '9')
{
ft_putchar(d, e, f);
f++;
}
e++;
}
d++;
}
}