#include <unistd.h>
void ft_putstr(char *str)
{
int i;
i = 0;
while (str[i])
{
write(1, &str[i], 1);
i++;
}
}
void wdmatch(char *s1, char *s2)
{
int i;
int j;
i = 0;
j = 0;
while (s2[i] && s1[j])
{
if (s2[i] == s1[j])
j++;
i++;
}
if (s1[j] == '\0')
ft_putstr(s1);
}
int main(int argc, char **argv)
{
if (argc == 3)
wdmatch(argv[1], argv[2]);
write(1, "\n", 1);
return (0);
}
To embed this project on your website, copy the following code and paste it into your website's HTML: