Add all git folders
This commit is contained in:
40
C_Piscine_C_00/git/ex06/ft_print_comb2.c
Normal file
40
C_Piscine_C_00/git/ex06/ft_print_comb2.c
Normal file
@@ -0,0 +1,40 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* 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++;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user