commit
This commit is contained in:
42
C_00/git/ex05/ft_print_comb.c
Normal file
42
C_00/git/ex05/ft_print_comb.c
Normal file
@@ -0,0 +1,42 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_print_comb.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/05 13:51:00 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/05 17:36:28 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_print_comb(void)
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
char str[3];
|
||||
|
||||
x = 0;
|
||||
y = 1;
|
||||
z = 2;
|
||||
while (x <= 7)
|
||||
{
|
||||
while (y <= 8)
|
||||
{
|
||||
while (z <= 9)
|
||||
{
|
||||
str[0] = x + '0';
|
||||
str[1] = y + '0';
|
||||
str[2] = z + '0';
|
||||
write(1, &str, 3);
|
||||
if (z++ != 9 || y != 8 || x != 7)
|
||||
write(1, ", ", 2);
|
||||
}
|
||||
z = ++y + 1;
|
||||
}
|
||||
y = ++x;
|
||||
}
|
||||
}
|
||||
21
C_00/git/ex05/main.c
Normal file
21
C_00/git/ex05/main.c
Normal file
@@ -0,0 +1,21 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* main.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/05 13:50:48 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/05 14:55:52 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
void ft_print_comb(void);
|
||||
|
||||
ft_print_comb();
|
||||
return (0);
|
||||
}
|
||||
6
C_00/git/ex05/main.sh
Executable file
6
C_00/git/ex05/main.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
norminette -R CheckForbiddenSourceHeader
|
||||
gcc -Wall -Wextra -Werror -o a.out *.c
|
||||
echo $(basename $PWD):
|
||||
./a.out
|
||||
rm -f a.out
|
||||
Reference in New Issue
Block a user