601827
C语言问题!!高手进!!
输出时改一下。#include#includevoid main(){double sum,a1,a2,a3,a,x,y,z,i,n;a1=a2=0;sum=a3=1;i=4;printf("Input n:");scanf("%lf",&n);if(n<=3)printf("error\n");elsewhile (i<=n){a=a1+a2+a3;x=a1;y=a2;z=a3;sum=sum+sqrt(a);a1=y;a2=z;a3=a;i++;}printf("a=%lf,sum=%lf\n",a,sum); //输出时不要取地址符“&”;按需求,不但要输出a,还要输出sum}
c语言问题,高手进
#include typedef struct vertex { int id; struct vertex *nextVertex; struct vertex *prevVertex; struct adjvex *head; }vertex; typedef struct adjvex{ int id; struct vertex *vertexHead; struct adjvex *prevAdjvex; struct adjvex *nextAdjvex; }adjvex; adjvex *getAPointerById(){ //交换两个方法的顺序 } void createVertex(int id,adjvex *head){ struct adjvex *cAdj; cAdj = getAPointerById(); // c++里面只用函数在前面定义了才能够访问。 } int main(){ }