69,371
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include "stdafx.h"
#include <stdlib.h>
typedef int ElemType;
typedef struct node
{
ElemType coef;
ElemType exp;
struct node * next;
}Node;
Node *CreatLink(int n);
int main(void)
{
int la, lb;
Node *pA, *pB;
puts("Enter the length of pA and pB");
scanf("%d %d", &la, &lb);
pA = CreatLink(la);
pB = CreatLink(lb);
}
Node *CreakLink(int n)
{
int c;
int coe, ex;
Node * pHead, * pNew;
Node * pNode;
pNew = (Node *)malloc(sizeof(Node));
pHead = pNew;
pHead->next = NULL;
pNode = pHead;
for(c = 0; c < n; c++)
{
pNew = (Node *)malloc(sizeof(Node));
if(pNew == NULL)
exit(0);
pNode->next = pNew;
puts("Enter the coef and exp");
scanf("%d %d", &coe, &ex);
pNew->coef = coe;
pNew->exp = ex;
pNew->next = NULL;
pNode = pNew;
}
return pHead;
}
Node *CreakLink(int n)
// ==^==
{
int c;
}
// 改为
Node *CreatLink(int n)
// ==^==
{
int c;
}