yjjjj
获得 0 次赞
帮助过12人
double fun(int n) { double t,sn=1.0; int i,j; for(i=1;i<=n;i++) { t=1.0; for(j=1;j<=i;j++) t*=j; sn+=1.0/t; } return sn; }其功能是计算并输出多项式Sn=1+1/1!+1/2!+1/3!+1/4!+....+1/n!;的值为什么下面这个函数不行double fun(int n){ double f=0.0,t=1.0;int i; for(i=1;i<n;i++) { t*=(1/i); f+=t; } return f; }
typedef struct student{ int num; struct student *next;},Student,*pst;Student g_head;pst GetPrevAddr(int num) { pst pstu = &g_head; while(pstu->next) { if(pstu->next->num == num) return pstu; pstu = pstu->next; } return NULL; } 声明的pstu是二级指针吗?pstu->next->num 这样指向是什么意思?