源代码
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
typedef struct polynomial
{
double coefficient;
int index;
struct polynomial *next;
}node;
struct polynomial *create();
void sort+++++++++++++++++++++++++(struct polynomial *head);
void add_subtract(struct polynomial *head1, struct polynomial *head2);
void display(struct polynomial *head);
void check(node *head1, node *head2);
int count;
int main()
{
int choice;
node *head1 = NULL;
node *head2 = NULL;
do{
printf("\n");
printf("┏━━━━━━━━━━一元稀疏多项式运算━━━━━━━━━━┓\n");
printf("┃ ┃\n");
printf("┃1----创建多项式 A&B 2----加法 A+B ┃\n");
printf("┃ ┃\n");
printf("┃3----减法 A-B 4----减法 B-A ┃\n");
printf("┃ ┃\n");
printf("┃5----显示多项式 A&B 0----退出程序 ┃\n");
printf("┃ ┃\n");
printf("┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n");
printf(" 请输入您的选择:");
scanf("%d", &choice);
printf(" ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
switch (choice)
{
case 0:
break;
case 1:
{
count = 0;
head1 = create();
head2 = create();
break;
}
case 2:
{
check(head1, head2);
count = 2;
add_subtract(head1, head2);
break;
}
case 3:
{
check(head1, head2);
count = 3;
add_subtract(head1, head2);
break;
}
case 4:
{
check(head1,