42_C_PISCINE/BSQ/ft_duplicated.c
Camille Chauvet 29ed24d567 init
2023-05-17 16:45:25 +00:00

34 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_duplicated.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/08/03 11:50:50 by cchauvet #+# #+# */
/* Updated: 2022/08/03 12:38:01 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
int ft_duplicated(char *str)
{
int i;
int j;
i = 0;
while (str[i + 1] != 0)
{
j = i + 1;
while (str[i] != str[j])
{
if (str[j] == 0)
break ;
j++;
}
if (str[j] != 0)
return (1);
i++;
}
return (0);
}