#include <stdio.h>

struct node {
	int value;
	struct node * next;
};

int main(void)
{
	int i=0;
	struct node top;
	struct node *newNode,*tmp;
	top.next=NULL; //うまくバグになる良いのだが　*/
	top.value=0;
	for (i=0;i<10;i++) {
		newNode=(struct node *) malloc(sizeof(struct node));
		newNode->next=top.next;
		newNode->value=i*3;
		top.next=newNode;
	}
	tmp=&top;
	while(tmp!=NULL) {
		printf("%d\n",tmp->value);
		tmp=tmp->next;
	}
	return 0;
}
