#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=⊤
while(tmp!=NULL) {
tmp=tmp->next;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpzdHJ1Y3Qgbm9kZSB7CglpbnQgdmFsdWU7CglzdHJ1Y3Qgbm9kZSAqIG5leHQ7Cn07CgppbnQgbWFpbih2b2lkKQp7CglpbnQgaT0wOwoJc3RydWN0IG5vZGUgdG9wOwoJc3RydWN0IG5vZGUgKm5ld05vZGUsKnRtcDsKCXRvcC5uZXh0PU5VTEw7IC8v44GG44G+44GP44OQ44Kw44Gr44Gq44KL6Imv44GE44Gu44Gg44GM44CAKi8KCXRvcC52YWx1ZT0wOwoJZm9yIChpPTA7aTwxMDtpKyspIHsKCQluZXdOb2RlPShzdHJ1Y3Qgbm9kZSAqKSBtYWxsb2Moc2l6ZW9mKHN0cnVjdCBub2RlKSk7CgkJbmV3Tm9kZS0+bmV4dD10b3AubmV4dDsKCQluZXdOb2RlLT52YWx1ZT1pKjM7CgkJdG9wLm5leHQ9bmV3Tm9kZTsKCX0KCXRtcD0mdG9wOwoJd2hpbGUodG1wIT1OVUxMKSB7CgkJcHJpbnRmKCIlZFxuIix0bXAtPnZhbHVlKTsKCQl0bXA9dG1wLT5uZXh0OwoJfQoJcmV0dXJuIDA7Cn0K