#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void ft_putchar(char c);
void ft_print_comb(void);
int main()
{
ft_print_comb();
return (0);
}
void ft_putchar(char c)
{
write (1, &c, 1);
}
void ft_print_comb(void)
{
int a;
int b;
int c;
a = '0';
while(a <= '7' && b <= '8' && c <= '9')
{
while(a <= '7')
{
while(b <= '8')
{
while(c <= '9')
{
/* ft_putchar(a);
ft_putchar(b);
ft_putchar(c); */
write(1,&a,1);
write(1,&b,1);
write(1,&c,1);
if (a != '7' || b != '8' || c != '9')
{
ft_putchar(',');
ft_putchar(' ');
}
}
c++;
}
b++;
}
a++;
}
}
[code]#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void ft_putchar(char c);
void ft_print_comb(void);
int main()
{
ft_print_comb();
return (0);
}
void ft_putchar(char c)
{
write (1, &c, 1);
}
void ft_print_comb(void)
{
int a;
int b;
int c;
a = '0';
while(a <= '7' && b <= '8' && c <= '9')
{
while(a <= '7')
{
while(b <= '8')
{
while(c <= '9')
{
/* ft_putchar(a);
ft_putchar(b);
ft_putchar(c); */
write(1,&a,1);
write(1,&b,1);
write(1,&c,1);
if (a != '7' || b != '8' || c != '9')
{
ft_putchar(',');
ft_putchar(' ');
}
}
c++;
}
b++;
}
a++;
}
}
non riesco a capire perchè la funzione compila ma non da output, premetto che dovrebbe stampare tutte le combinazioni tra 3 numeri, grazie a chiunque risponderà.