예제 #1
0
파일: main.c 프로젝트: Strade288/42
int		main(int argc, char **argv)
{
	if (argc == 2)
		ord_alphlong(argv[1]);
	else
		write(1, "\n", 1);
	return (0);
}
예제 #2
0
파일: ord_alphlong.c 프로젝트: Forest218/42
int			main(int ac, char **av)
{
	t_len		*list;

	if (ac == 2)
	{
		list = ord_alphlong(av[1]);
		while (list)
		{
			while (list->wordlist->next)
			{
				printf("%s ", list->wordlist->word);
				list->wordlist = list->wordlist->next;
			}
			printf("%s", list->wordlist->word);
			list = list->next;
			printf("\n");
		}
	}
	return (0);
}
예제 #3
0
int		main(int argc, char **argv)
{
  t_list	*first;
  t_list	*len;

  if (argc > 1)
    {
      first = new_list(NULL);
      ord_alphlong(first, argv[1]);
      sort_list(first, &my_alphstr_cmp);
      len = new_list(NULL);
      ord_lenlist(first, len);
      while (len != NULL)
	{
	  if (len->data != NULL)
	    print_alphlong(first, *(int *)(len->data));
	  len = len->next;
	}
    }
  else
    my_putchar('\n');
  return (0);
}