还剩6页未读,继续阅读
文本内容:
公路桥梁荷载受力计算考虑抗扭因素二不考虑抗扭因素code——=10每根主梁的抗扭惯性矩It----------每根主梁的抗弯惯性矩II----------人行道宽度RR---------行车道宽度BB---------主梁间距AA---------主梁跨径LL----------主梁个数N-----------车道数CO---------荷载类型个数M-----------1=M=4存放各种类型荷载序号MI----------一一人群荷载1汽车荷载2-----挂车荷载3——一—履带车荷载4单位采用国际单位#include stdio.h#include stdlib.h#include alloc.h#include process.hvoid computeMlintcode,double It,double II,double Redouble BB,doubleAA,double LL,int N,int C0,int M,int MI
[4],double*MM;int maindouble*MM,It,n,RR,BB,AA,LL;int i,j,codekN,M,C0,MI
[4];FILE*fpl,*fp2;char in
[20],out
[20],str
[30];请输入初始数据文件名;printfscanf%s,in;请输入结果数据文件名;printf\nscanf%s,out;%iffpl=fopenin r,,==NULL{printf\n\n打开文件s失败,\n,in;exitO;%创建文件失败iffp2=fopenout,w==NULL{printf s\n,out;exit0;fscanffpl,%s%s%s%s%s,str str strstr,str;,/zfscanffpL%d%lf%lf%lf%lf,code,It,ILRR,BB;fscanffpl,%s%s%s%s%s,str,str,str,str,str;fscanffpL%lf%lf%d%d%d,AA,LLN,COM;fori=0;i4;i++MI[i]=O;值有误!ifM4Ml{printf\nM\n,exitO;}值有误!ifN4Ml{printf\nN\nexitO;}fori=0;iM;i++fscanffpl,%d,MI[i];k=N+l/2;MM=mallock*M*sizeofdouble;=二值太大了ifMM NULL{printf\nK\n;return;}fori=0;ik*M;i++MM[i]=0;computeMlcode,It,n,RR,BB,AA,LL,N,CO,M,MLMM;fori=0;iM;i++{switchMI[i]{case1:人群荷载fprintffp2,break;case2:汽车荷载fprintffp2,break;挂车荷载case3:fprintffp2,break;履带车荷载case4:fprintffp2,break;fprintffp2\n;/fori=0;ik;i++{fprintffp2,%4d,i+l;forj=0;jM;j++fprintffp2,%15lf,MM[i*M+j];fprintffp2\n;/fclosefpl;fclosefp2;void computeMlintcode,double Itdouble II,double RR,doublezBB,double AAdouble LLJntNJnt COJntMJnt MI
[4],double*MMZint k,i,j,z;doubleB,M0,MQ,MC,temp=0,E,El,TC,CC,TG,Tl,T2,tt;k=intN+l/2;输入数据有误!ifN=l||Ik=O||AA=O{printf\rT;retum;}ifcode==l{temp=N;temp=temp*temp*temp-
1.0;temp=AA*AA*te mp;temp=N*LL*LL/temp;;B=l+
0.425*temp*It/HelseB=
1.0;tt=N;E=N+l/
2.0;tt=
1.0/tt;fori=0;ik;i++{Tl=
1.0/N+tt*E-i-
1.0*E-
1.0*B;T2=
1.0/N+tt*E-i-
1.0*E-N*B;TC=T1+T2/
2.O;TG=T1-T2/N-1*AA;forj=0;jM;j++switchMI[j]{case1:El=RR+BB/
2.0;ifTCTG*Eltemp=2*TC;else temp=TC+TG*El;break;case2:CC=
1.0;temp=0;forz=l;z=CO;z++{ifz==3CC=
0.8;ifz==4CC=
0.7;El=BB/
2.0-
1.55*z-l-
1.4;MO=TC+TG*El;MC=CC*z*MO;ifMCtemptemp=MC;break;temp=TC+TG*BB-
4.7/
2.0;break;case4:temp=TC+TG*BB-
4.5/
2.0;break;MM[i*M+j]=temp;。