热门

最新

红包

立Flag

投票

同城

我的

发布
lctlinger
涛子丶白了你一眼
5 年前
truelctlinger

JAVA怎么保证线程安全 ?

CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
问什么只输出最后的数呢#include<stdio.h>#include<stdlib.h>struct stu{ int num; struct stu *next;};struct stu *creat(){ struct stu *head; struct stu *p,*q; q=p=(struct stu*)malloc(sizeof(struct stu)); head=NULL; for(; q->num!=10;) { printf("输入\n"); scanf("%d",&p->num); if(head==NULL) { head=p; } else { q->next=p; q=p; } q->next=NULL; } return head;}void main(){ struct stu *u; u=creat(); for(; u!=NULL; u=u->next) { printf("%d",u->num); }}
立即登录