亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

大神快看看我的動態鏈表哪里錯了

大神快看看我的動態鏈表哪里錯了

C
DOUBLE_l 2016-11-30 22:54:02
#include <stdio.h> #include <stdlib.h> typedef struct Date{ int year; int month; int day; struct Date* next;}date; void main() { int i; date*head,*p,*p1; *p=(date*)malloc(sizeof(date)); p1=head=p; for(;p->next!=NULL;) { scanf("%d,%d,%d",&p->year,&p->month,&p->day); if(p->year==0&&&p->month==0&&p->day==0) {p->next=NULL;continue;} *p=*p=(date*)malloc(sizeof(date)); p1->next=p; p1=p; } for(;head->next!=NULL;) { printf("%d,%d,%d\n"head->year,head->month,head->day); } }
查看完整描述

3 回答

?
DOUBLE_l

TA貢獻45條經驗 獲得超12個贊

#include <stdio.h> #include <stdlib.h> typedef struct Date{ int year; int month; int day; struct Date* next;}date; void main() { int i; date*head,*p,*p1; *p=(date*)malloc(sizeof(date)); p1=head=p; for(;p->next!=NULL;) { scanf("%d,%d,%d",&p->year,&p->month,&p->day); if(p->year==0&&&p->month==0&&p->day==0) {p->next=NULL;continue;} *p=*p=(date*)malloc(sizeof(date)); p1->next=p; p1=p; } for(;head->next!=NULL;) { printf("%d,%d,%d\n"head->year,head->month,head->day); } }快看看,
查看完整回答
反對 回復 2016-11-30
  • 3 回答
  • 0 關注
  • 1475 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號