文章

2

粉丝

418

获赞

0

访问

16.7k

头像
不太符合题型要求哦
P1015 贵州大学机试题
发布于2019年12月19日 17:38
阅读数 8.7k

#include<stdio.h>
#include<malloc.h>
#define LN sizeof(struct Note)
struct Note{
    int qaq;
    struct Note *next;
};

struct Note *create(int *x){
    struct Note *head,*p1,*p2;
    p1=p2=(struct Note *)malloc(LN);
    p1->qaq=x[0];head=p1;int i;
    for(i=1;i<=5;i++){
        p2->next=p1;p2=p1;
        p1=(struct Note *)malloc(LN);
        p1->qaq=x[i];
    }
    p2->next=NULL;
    return(head);
}

void print(struct Note *head){
    struct Note *p;p=head;
    for(;p!=NULL;){
        printf("%d ",p->qaq);
        p=p->next;
    }
}

int main(){
    int a[5],i,j,min,t;
...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发