第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

將一個(gè)文件分成幾個(gè)源文件,鏈表為例

將一個(gè)文件分成幾個(gè)源文件,鏈表為例

C
DYXnice216444 2016-06-21 20:10:44
d1.c:#include<stdio.h>#include"f1.h"main(){? ? struct stu *head;? ? int num;? ? head=creat();? ? list(head);? ? scanf("%d",&num);? ? head=del(head,num);? ? list(head);}d2.c:#include<stdio.h>#include<stdlib.h>#include"f1.h"#define LEN sizeof(struct stu )struct stu *creat(void){? ? struct stu *p1,*p2;? ? struct stu *head=NULL;? ? p1=p2=(struct stu *)malloc(LEN);? ? scanf("%d%f%s",&p1->num,&p1->score,&p1->gender);? ? whil(p1->num!=0)? ? {? ? ? ? if(head==NULL)? ? ? ? ? ? head=p1;? ? ? ? else? ? ? ? ? ? p2->next=p1;? ? ? ? p2=p1;? ? ? ? p1=(struct stu *)malloc(LEN);? ? ? ? scanf("%d%f%s",&p1->num,&p1->score,&p1->gender);? ? }? ? p2->next=NULL;? ? free(p1);? ? return head;};struct stu *del(struct stu *head,int num){? ? struct stu *p1,*p2;? ? p1=p2=(struct stu *)malloc(LEN);? ? if(head==NULL)? ? ? ? printf("á′±í?a??");? ? else? ? {? ? ? ? p1=head;? ? ? ? while(num!=p1->num&&p1->next!=NULL)? ? ? ? {? ? ? ? ? ? p2=p1;? ? ? ? ? ? p1=p1->next;? ? ? ? }? ? ? ? if(num==p1->num)? ? ? ? {? ? ? ? ? ? if(head=p1)? ? ? ? ? ? ? ? head=p1->next;? ? ? ? ? ? else? ? ? ? ? ? ? ? p2->next=p1->next;? ? ? ? }? ? }? ? free(p1);? ? return head;};void list(struct stu *head){? ? struct stu *p;? ? p=head;? ? while(p!=NULL)? ? {? ? ? ? printf("%d%f%s",p->num,p->score,p->gender);? ? ? ? p=p->next;? ? }}f1.h:#ifndef f1_h#define f1_hstruct stu?{? ? int num;? ? float score;? ? char gender[50];? ? struct stu *next;};struct stu *creat(void);struct stu *del(struct stu *head,int num);void list(struct stu *head);#endif // f1_h
查看完整描述
  • 1 回答
  • 0 關(guān)注
  • 1316 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)