Use a circular linked list to represent a polynomial f (x). Please define the node structure of the linked list and write a function value (x), Calculate the value of the polynomial at x = x0

Use a circular linked list to represent a polynomial f (x). Please define the node structure of the linked list and write a function value (x), Calculate the value of the polynomial at x = x0


#Include # include "stdlib. H" # include / / the structure of the node typedef struct node {int Xishu; int Zhishu; struct node * next;} listnode; / / new list listnode * createlist() {listnode * head, * node1, * node2; int Xi, Zhi; head



Program design: define a function, calculate the value of the polynomial A0 + A1 * x + A2 * x * x +A9 * x * x * x * x * x * x * x * x * x value
Define a function to calculate the value of polynomial A0 + A1 * x + A2 * x * x +Where a [10] = {2.3, 3.2, 7, - 2.5, 8, 2.9, 5.3, 5, 3.7, 3.2,}, thank you!


#Include # include void main() {double a [10] = {2.3,3.2,7, - 2.5,8,2.9,5.3,5,3.7,3.2}; double x = 1.2; double sum = 0; int i; sum = a [9]; for (I = 8; I > = 0; I --) / * Qin Jiushao's shujiuzhang * / sum = sum * x + a [i]; printf ("x = - LF, nsum = - lf



The following functions are defined: int fun (double a, double B) {return a * B;}
There are the following function definitions:
int fun (double a,double b)
{return a*b;}
If the variables used in the following options have been correctly defined and assigned, the wrong function call is ()
Z = fun (fun (x, y) x, y)
The answer to the explanation is: the number of formal parameters, the type of actual parameters to be consistent? What's the matter


Fun (x, y) x, this is god horse, of course wrong



18. Have the following function definition: int fun (, double a, double B) {return a * B;}
18. There are the following function definitions:
int fun(,double a ,double b)
{ return a*b;
}If the variables used in the following options are correctly defined and assigned values, the wrong function call ()
A. if(fun(x,y)){.} B. z=fun(fun(x,y),fun(x,y));
C. z=fun(fun(x,y)*x,y) ; D.fun(x,y);
The answer is d. why?
24. The output of the following program is ()
#include"stdio.h"
#define SUB(X,Y)(X)* Y
main( )
{int a=3,b=4;
printf ("%d\n",SUB(a++,b++));}
A. 12 b.15 c.16 d.20 the answer is a. how does it count?
25. The output of the following program is ()
#include"stdio.h"
int fun(int x,int y)
{static int m=0,i=2;
i+=m+1;
m=i+x+y;
return m;}
main( )
{int j=4,m=1,k;
k=fun(j,m); printf ("%d,",k);
k=fun(j,m); printf ("%d\n",k);
The answers are 8 and 17. I don't know how 17 is calculated?


First of all, this function is returned by the value, so only D is not an assignment operation



3. The following correct function definition is (). A. double fun (int x, int y); {int Z; Z = x + y; return Z;}
3. The correct function definition below is ()
A.double
fun(int x,int y);
{int z;
z=x+y; return z;}
B.fun(int x,y)
{int z; return z;}
C.double
fun(int x,int y);
{double z;
z=x+y;
return z;}
D.double fun(
x, y)
int x,y;
{double z; z=x+y; return z;}


The. AB return value of C pair is inconsistent with the function definition. The int, x, y definitions of D cannot be between fun() and {}



Seek 1! + 2! + 3! + 4! + +It's a simple way to find the sum of 20! And this is a regular way. The problem is like this, = 1x1 = 2x1 = 3x2x1 = 4x3x2x1 is added to 20 all the time. The front of each number is the same. The main thing is to use the computer to type out a structure diagram instead of writing it out, right


Programming solution is very simple, summation formula estimation is not
Computer solution is done in one sentence:
Enter table [sum [K!, {K, 1, n}], {n, 20}]
Output:
1, 3, 9, 33, 153, 873, 5913, 46233, 409113, 4037913, 43954713, \
522956313, 6749977113, 93928268313, 1401602636313, 22324392524313, \
378011820620313, 6780385526348313, 128425485935180313, \
2561327494111820313



Sn=1/1!+1/2!+1/3!+1/4!+…… +1/n!+……
N infinity,


e=1/0!+1/1!+1/2!+1/3!+1/4!+…… +1/n!+…… So 1 / 1! + 1 / 2! + 1 / 3! + 1 / 4! + +1/n!+…… =e-1



It's like a factorial
In a kindergarten, there are eight children in abcdefgh, and you are a kindergarten teacher. Now there are eight chairs in front of you. Let these eight children sit on the chairs respectively. It is known that a and B are twins, so they can't sit together. As long as they sit together, they will fight. How many seating plans are there?


Use the method of inserting space: first line up the other six children, and then insert the two twins into the seven spaces
There are 6! * a (7,2) = 3024 species



Permutation problem (factorial)!
n=1 2 3 4 5 6 7 8
Find out the above number of n!


1!=1
2!=2
3!=6
4!=24
5!=120
6!=720
7!=5040
8!=40320



40-32 △ 2 = 4! Right?


Yeah, you're right