c
#include<stdio.h>#include<stdlib.h>#include<malloc.h>#include "List.h"int main(void){List L1_1,L2_1,L3_1;ElementType n1,n2;printf("请输入第一个多项式的项数:");scanf("%d",&n1); printf("\n");printf("请输入第一个多项式的系数和指数:"); printf("\n");CreateList(&L1_1,n1);PrintList(L1_1);printf("\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");printf("\n请输入第二个多项式的项数:");scanf("%d",&n2); printf("\n");printf("请输入第二个多项式的系数和指数:"); printf("\n");CreateList(&L2_1,n2);PrintList(L2_1);printf("\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");L3_1=MultPolynomial(L1_1,L2_1);PrintList(L3_1);}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5#ifndef _LIST_H_typedef int ElementType;struct Node;typedef struct Node *PtrToNode;typedef PtrToNode List;typedef PtrToNode Position;struct Node{ElementType Cofficient;ElementType Exponent;Position Next;};void CreateList(List *L,int n);void PrintList(List L);List MakeEmpty(List L);void CreateEmptyList(List *L);int IsEmpty(List L);int IsLast(Position P,List L);Position Find(ElementType X,List L);void Delete(ElementType X,ElementType Y,List L);Position FindPrevious(ElementType X,List L);void Insert(ElementType X,ElementType Y,List L,Position P);void InsertH(ElementType X,ElementType Y,List L,Position P);void DeleteList(List L);Position Header(List L);Position First(List L);Position Advance(Position P);ElementType Retrieve(Position P);List MultPolynomial(List L1,List L2); #endif %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#include "List.h"#include<stdio.h>#include<stdlib.h>#include<malloc.h>void CreateList(List *L,int n){Position P,P1;int i;*L=(Position)malloc(sizeof(struct Node));(*L)->Next=NULL;P1=*L;printf("请输入%d对数据(以空格隔开):\n",n); for(i=n;i>0;i--){ P=(Position)malloc(sizeof(struct Node));scanf("%d",&P->Cofficient);scanf("%d",&P->Exponent);P->Next=P1->Next; P1->Next=P;P1=P;}}void PrintList(List L){printf("已保存链表\n");Position P;P=L->Next;while(P->Next!=NULL){printf("%d ",P->Cofficient); printf("%d ",P->Exponent);P=P->Next;} printf("%d ",P->Cofficient); printf("%d ",P->Exponent);}void FatalError(char a[]){printf("%s",a); }int IsEmpty(List L){return L->Next==NULL; }int IsLast(Position P,List L){return P->Next==NULL; }List MakeEmpty(List L){List q,p;p=L->Next;while(p!=NULL){ q=p->Next;free(p);p=q;}L->Next=NULL;return L;}Position Find(ElementType X,List L){Position P;P=L->Next;while((P!=NULL)&&(P->Exponent!=X)) {P=P->Next;}return P;}Position findPrevious(ElementType X,List L)</s