xfpoly.c

来自「适合大型数值计算代码 现在网络上已经找不到了 购买需要20$」· C语言 代码 · 共 33 行

C
33
字号
/* Driver for routine fpoly */#include <stdio.h>#define NRANSI#include "nr.h"#include "nrutil.h"#define NVAL 15#define DX 0.1#define NPOLY 5int main(void){	int i,j;	float x,*afunc;	afunc=vector(1,NPOLY);	printf("\n%38s\n","powers of x");	printf("%8s %10s %9s %9s %9s %9s\n",		"x","x**0","x**1","x**2","x**3","x**4");	for (i=1;i<=NVAL;i++) {		x=i*DX;		fpoly(x,afunc,NPOLY);		printf("%10.4f",x);		for (j=1;j<=NPOLY;j++) printf("%10.4f",afunc[j]);		printf("\n");	}	free_vector(afunc,1,NPOLY);	return 0;}#undef NRANSI

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?