0
0
Files
42piscine/C_00/git/ex06/ft_print_comb2.c
Guy Baconniere d30270c485 commit
2021-08-20 10:02:38 +02:00

41 lines
1.3 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_comb2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/05 17:39:09 by gbaconni #+# #+# */
/* Updated: 2021/08/06 11:45:50 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_print_comb2(void)
{
int x;
int y;
char str[2];
x = 0;
while (x <= 99)
{
y = 1;
while (y <= 99)
{
str[0] = (x / 10) + '0';
str[1] = (x % 10) + '0';
write(1, &str, 2);
write(1, " ", 1);
str[0] = (y / 10) + '0';
str[1] = (y % 10) + '0';
write(1, &str, 2);
if (y != 99 || x != 99)
write(1, ", ", 2);
y++;
}
x++;
}
}