/******************************************************
*******************************************************/ 【程序编程相关:LINUX--a free unix-3】 多项式相乘 【推荐阅读:WMI 脚本入门:第一部分】#include<stdlib.h> 【扩展信息:如何解决 SQL Server 2000】#include<stdio.h>#include<malloc.h>//多项式中的一项的结构
typedef struct term{
double coef; int expn; struct term* next;}polynode ,*ppolynode;//创建一个保存多项式的链表,返回指向头结点的指针.多项式按指数降序排列
ppolynode createpoly(){ polynode *p,*q,*s,*head=null; double coef; int expn;head=(ppolynode)malloc( sizeof(polynode) );
if(head==null) { printf("allocable memory fail!\n"); return null; } head->coef =0.0; head->expn =0; head->next =null;printf("please input coefficient and exponent (intput 0 0 end):\n");
//scanf("%lf%d",&coef,&expn); printf("please input coefficient:"); scanf("%lf",&coef); printf("please input exponent:"); scanf("%d",&expn);... 下一页