# include <stdio.h>
# include <stdlib.h>

/** Dimiourgia listas akeraion arithmon **/
typedef struct Node
{
	int value;
	struct Node *next;
}List;

void addElement(List ** head, int x) 
{
    List  *new_node;
    new_node = (List *)malloc(sizeof(List));
    new_node->value = x;
    new_node->next = *head;
    *head = new_node;
}


void printList(List *t)
{
	while(t!=NULL)
	{
		printf("element %d \n",t->value);
		t=t->next;
	}
}

int main()
{
	List *head=NULL;
	int x;
	do
	{
		printf("Doste thetiko arithmon ?\n");
		scanf("%d",&x);
		if(x>0)	addElement(&head,x);
	}while(x>0);
	printList(head);
	return 0;
}
