C语言程序,麻烦高手看下哪里错了啊~

来源:百度知道 编辑:UC知道 时间:2024/06/16 04:39:16
#include "stdio.h"
#include "math.h"
#define PI 3.1415926
main()
{
FILE *fp;

double i=0;
double L1=150,LAD=750,LDE=375,H1=800,LAB=500,w=6.28,c1,c2,c3,a,LAC,b,Sc,w3,vca,vD,vE,aDn,aDt,aE;
fopen("123.xls","w+");
fprintf(fp,"s\tv\ta\n");
for(i=0;i<90;i+=10)
{c1=i*PI/180;
a=(L1*sin(c1)+LAB)/(L1*cos(c1));
c2=atan(a);LAC=L1*cos(c1)/cos(c2);b=(H1-LAD*sin(c2))/LDE;
c3=asin(b);Sc=LAD*cos(c2)-LDE*cos(c3);w3=w*L1*cos(c1-c2)/LAC;
vca=w*L1*sin(c2-c1);vD=w*L1*cos(c1-c2)*LAD/LAC;
vE=vD*sin(c3+c2)/cos(c3);aDn=w3*w3*LAD;
aDt=(w*w*L1*sin(c1-c2)+2*vca*w3)*LAD/LAC;
aE=(aDn*cos(c2+c3)-aDt*sin(c2+c3))/cos(c3);
fprintf(fp,"%12.3f\t%12.3f\t%12.3f\n",Sc,vE,aE);
}
for(i=100;i<270;i+=10)
{c1=i*PI/180;
a=(L1*sin(c1)+LAB)/(L1*cos(c1));c2=PI+atan(a);
LAC=L1*cos(c1)/cos(c2);b=(H1-LAD*sin(c2))/LDE;
c3

fopen("123.xls","w+");前面少了fp=
应该是
fp=fopen("123.xls","w+");

因为个人习惯不同,写程序的方法也不同。你先说你要实现什么功能吧。一大堆我都懒得看了,呵呵。我也是学C++的。