笔记
我不要秃头啊o(^o^)o
这个作者很懒,什么都没留下…
展开
-
求一元多项式的值
求一元多项,在x值确定下,式子的值,主要注意pow()函数的用法,参数是浮点型的即可 //求一元多项式的值 #include<stdio.h> #include<math.h> double poly(double x,int n,double a[])//函数求一元多项式的值 { int exp; double sum=0; for(exp=0;exp<n;exp++) { sum+=(a[exp]*pow(x,exp)); } return sum; }原创 2021-08-08 00:08:07 · 994 阅读 · 0 评论 -
严蔚敏《数据结构》表达式求值
/表达式的值/ #include<bits/stdc++.h> using namespace std; #define N 100 #define STACK_INIT_SIZE 5 #define STACKINCREMENT 10 #define OK 1 #define ERROR 0 typedef char CSElemType; typedef int SElemType; typedef int Status; //字符栈 typedef struct{//栈的顺序存储表示 CS原创 2021-05-13 22:30:55 · 472 阅读 · 0 评论 -
数据结构-严蔚敏版-顺序表及其基本操作
/*顺序表-初始化 */ #include<stdio.h> #include<stdlib.h> #define LIST_INIT_SIZE 100//顺序表的初始存储空间 typedef int ElemType; // 顺序表的结构体定义 typedef struct{ ElemType *elem;//存储空间的地址 int length;//当前存放的元素个数 int listsize;//此顺序表的实际长度 }SqList; //初始化顺序表 void InitList原创 2021-04-04 23:08:26 · 221 阅读 · 0 评论 -
动态分配数组
新手多多包含,大家有什么指点多多评论呀! 输入一组数据,放到数组中,数据元素个数动态的由输入函数完成,求输入数据的最大值、最小值,并通过函数参数返回所求结果 #include<stdio.h> #include<stdlib.h> int* DyArray(int **pDyArray,int n)//动态分配空间 { pDyArray=(int)malloc(n*sizeof(int)); return *pDyArray; } int InputDyArray(int *pDy原创 2021-04-03 15:24:44 · 1162 阅读 · 0 评论