| 网站首页 | 业界新闻 | 小组 | 交易 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
 Reworld，下班在家制作游戏，1500万奖金等你拿 以码会友 以友辅仁

问题点数：0  回复次数：0

#include<stdio.h>
#include<stdlib.h>
typedef struct  Node{
int xishu;
int mic;
struct Node * next;

{
int i;
for (i=1; i<=n; i++)
{
scanf("%d%d", &(s->xishu), &(s->mic));
s->next = NULL;
rear->next = s;
rear = s;
}
}
{
while(p)
{
printf("%dx%d ", p->xishu, p->mic);
p = p->next;
if (p)
if (p->xishu > 0) putchar('+');
}
}
{
pa = ha->next;        pb = hb->next;  pc = hc;
while(pa && pb)
{
if (pa->mic < pb->mic)
{
pc->next = pa;    pc = pc->next;    pa = pa->next;
}
else if(pa->mic > pb->mic)
{
pc->next = pb;    pc = pc->next;  pb = pb->next;
}
else
{
int xsh;
xsh = pa->xishu + pb->xishu;
if (xsh)
{
pa->xishu = xsh;
pc->next = pa;  pc = pc->next;
}
pa = pa->next;        pb = pb->next;
}
}
if (pa)    pc->next = pa;
if (pb) pc->next = pb;
}
int main()
{
int n;
printf("请输入多项式 A 的项数: ");
scanf("%d", &n);
printf("输入各项的系数和幂次: ");
printf("请输入多项式 B 的项数: ");
scanf("%d", &n);
printf("输入各项的系数和幂次: ");
printf("A+B的结果多项式为: ");

}

• 1
• 1/1页
• 1