- 博客(10)
- 资源 (3)
- 收藏
- 关注
转载 基数排序
代码基本基于大神,自己研究精进了一下 /*typedef struct { int Coefficient;//系数 int Exponent;//指数 }ElementType;//针对多项式的结构声明,不知道是否可以调换,MARK并尝试;事实上必须声明*/ typedef int ElementType; #ifndef _List_H #define _List_H
2017-08-29 15:39:15 246
原创 多项式链表-算法设计与数据结构
借鉴了大神的思路与代码,主要还是运用来书上的,C语言是小白的我学会了结构的使用方法,有了更多的理解, 对这些代码进行了学习理解与改进,感觉不错 list.h typedef struct { int Coefficient;//系数 int Exponent;//指数 }ElementType;//针对多项式的结构声明,不知道是否可以调换,MARK并尝试;事实上必须声明 #i
2017-08-28 09:05:13 457
原创 HORNER(霍纳)法则的C实现以及算法比较 2.10
这个是2.10题的答案 double algorithm4_horner(double X,int N) { double Poly=0; for(int i=N;i>=0;i--) { Poly=Poly*X+1; //printf("every temp:%f\n",temp); } return Poly; } 代码很长,可以直接去看结果 please input
2017-08-10 17:35:27 510
原创 C语言算法检验 2.9题
又一道算法检验,简直可怕; 笔者又加了系统自带的pow进行了测试 #include #include #include #include double A,B,C; double algorithm1_pre(double X,int N) { double temp=1; for(int i=0;i<N;i++) { temp=temp*X; //printf("every t
2017-08-10 16:45:35 296
原创 数据结构与算法设计 习题2.7题 算法分析
真的是好算法,真厉害 话不多说#include #include #include #include #define MAXN 1000 #define MAXN1 1000000 int A[MAXN1],B[MAXN1],C[MAXN1],Used[MAXN1]; /* 编写printarray函数*/ void printarray(int ARRI[],int len) { for
2017-08-10 11:59:22 828
原创 差比数列通解(1.6)
错位相减法 如果差位为n次? 如何用程序解决(迭代) #include #include #include int jiecheng(int n) { if(n<=1){return 1;} if(n>1){return n*jiecheng(n-1);} } int zuhe(int n,int m) { if(m>=n){return 1;} return jiecheng(n)
2017-08-07 16:18:13 729
原创 c语言文件操作:FOR 1.4题(知识储备)
文件指针的运用: FILE * EG:FILE *FP 打开函数:fopen void test() { FILE *fp; fp=fopen("D:/test.doc","r"); } 文件使用方式 意 义 “rt” 只读打开一个文本文件,只允许读数据 “wt” 只写打开或建立一个文本文件,只允许写数据 “at
2017-08-04 17:11:36 427
原创 输出任意实数PrintDigit
输出任意实数 #include #include #define PrintDigit( Ch ) ( putchar( ( Ch ) + '0' ) ) //这里借助别人的定义,实际不太懂 void printin(unsigned int N) { if(N>=10) { printin(N/10); } PrintDigit(N%10); } void pri
2017-08-04 11:59:12 1776
五子棋人机版0.2
2017-11-22
五子棋人机版0.1源码
2017-11-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人