- 12
- 0
- 约1.22万字
- 约 31页
- 2017-06-05 发布于河南
- 举报
一元多项式加减乘除源代码(国外英文资料)
一元多项式加减乘除源代码
/ / Polynomial_list
/ / function: enter two polynomials (dont be in the order of the ascending power, the program will automatically merge the same class and sort), add and subtract and multiply and divide
# include stdio, h
# include stdlib. H
H # include math.h
/ / node definition
Typedef struct PolyNode
{
Int exp. / / index
Float coef. / / coefficient
PolyNode * next;
} PolyNode, * PolyList;
/ / function declaration
PolyList CreatePolyList (); / / create polynomial lists and return headers
Void DisplayPolyList (PolyList Poly real); / / display polynomial
Void DestroyPolyList PolyList (L); / / release the storage space for the list
Void MergePoly (PolyList Poly real); / / the polynomial and the same class
Void SortPoly (PolyList Poly real); / / put the polynomial in ascending order
PolyList PolyA, PolyList PolyB. / / polynomials, return and polynomial chain headers
PolyList polya, PolyList polyb. / / polynomials, the return differential polynomial chain header
PolyList PolyA, PolyList PolyB. / / polynomials, which are returned by PolyC
PolyList PolyDivide. / / polynomials, the results are stored in PolyC, separated by nodes with coefficients of 0
/ / function implementation
/ / create polynomial lists and return headers
PolyList CreatePolyList ()
{
PolyNode * s, * rear, * head.
Int e; / / index
Float c; / / coefficient
Int n = 1; / / counter
PolyNode *) malloc (PolyNode);
Rear = head;
/ / the coefficient and exponent of the input polynomial, if the input coefficient is 0
Printf ( please enter the coefficients and indexes of the % d item in the polynomial (separated by commas) : , +)
Scanf ( % f, % d, ).
While (fabs (c) 1e-6)
PolyNode *) malloc (PolyNode);
S- exp = e;
S-, coef = c;
Rear - next = s;
Rear = s;
Printf ( please enter the coefficients and indexes of the % d term of the polynomial, );
Scanf ( % f, % d, ).
}
Rear - next = NULL;
Return the head;
}
/ / calculate two polynomials (not in order), and result in the list PolyC, and return
P
您可能关注的文档
- Dota小白必看(国外英文资料).doc
- Dreamweaver常用代码(国外英文资料).doc
- DNF单机版游戏攻略(国外英文资料).doc
- dns干事器未照顾(国外英文资料).doc
- dxgrid常用属性(国外英文资料).doc
- D英语词汇(国外英文资料).doc
- e8语行动实际看可口可乐告白语的语用计谋(国外英文资料).doc
- EAN13通用商品条形码(国外英文资料).doc
- editpuls使用(国外英文资料).doc
- Education in Britain(国外英文资料).doc
- GB 14287.2-2026电气火灾监控系统 第2部分:剩余电流式电气火灾监控探测器.pdf
- 《GB 14287.2-2026电气火灾监控系统 第2部分:剩余电流式电气火灾监控探测器》.pdf
- GB 7956.20-2026消防车 第20部分:特种底盘消防车.pdf
- 《GB 7956.20-2026消防车 第20部分:特种底盘消防车》.pdf
- 中国国家标准 GB 7956.20-2026消防车 第20部分:特种底盘消防车.pdf
- 《GB/T 22576.1-2026医学实验室 质量和能力的要求 第1部分:通用要求》.pdf
- 中国国家标准 GB/T 22576.1-2026医学实验室 质量和能力的要求 第1部分:通用要求.pdf
- GB/T 22576.1-2026医学实验室 质量和能力的要求 第1部分:通用要求.pdf
- GB/T 28029.14-2026轨道交通电子设备 列车通信网络(TCN) 第2-8部分:以太网一致性测试.pdf
- 《GB/T 28029.14-2026轨道交通电子设备 列车通信网络(TCN) 第2-8部分:以太网一致性测试》.pdf
最近下载
- 同济大学《计算机体系结构》笔记-复习资料.pdf VIP
- T_QLY 072—2021_贵州小吃丝娃娃烹饪技术规范.pdf VIP
- 工学一体化课程《小型网络管理与维护》任务1单元5教学单元活动方案.docx VIP
- 混凝土—建筑材料混凝土的应用(建筑材料).pptx
- GB3469-83《文献类型与文献载体代码》.pdf VIP
- 2025年度组织生活会普通党员个人对照检查发言材料(五个带头).docx VIP
- 《电子商务基础与实务》(第三版)课件全套许应楠第1--9章电子商务概述、电子商务法律法规--智慧零售.pptx
- 2026年出海全球展望报告.pdf
- 财会类本科毕业论文.docx VIP
- 《建筑材料应用》课件.ppt VIP
原创力文档

文档评论(0)