大学物理实验3.5液体表面张力系数的测量测量校准曲线,得出斜率k和截距-b;测量时单位为f’/Mn*m-1,f/mg;可通过以下C语言程序计算表面张力系数及不确定度#includestdio.h#includestdlib.h#includemath.hvoidBIAOMIANZHANGLI(floatk,floatb,floatnum[],floatm[])/*计算表面张力*/{inti;floatt=0.0;/*m[]记录表面张力*/for(i=0;i5;i++){m[i]=(num[i]+b)/k;printf(%.4f\t,m[i]);}printf(\n);}voidZHANGlixishu(intn,floatm[],floata[])/*液体表面张力系数的计算*/{/*a[i]记录表面张力系数*/inti=0;for(i=0;in;i++){a[i]=m[i]/(3.14*(15.91+20.69));printf(%.4f\t\t,a[i]);}printf(\n);}voidPING(floata[],float*k)/*计算表面张力系数的平均值*/{floaty=0.0;/*k记录不确定度的平均值*/inti;for(i=0;i5;i++){y=y+a[i];}*k=y/5;printf(%.4f\n,*k);}voidBUquedingdu(floata[],float*k)/*计算不确定度*/{floatp=0.0;/*p记路不确定度*/inti;for(i=0;i5;i++){p=p+(a[i]-*k)*(a[i]-*k);}p=sqrt(p/20.0);printf(%.4f\n,p);}intmain(){inti,j,n=5;floatm[5],num[5],a[5],k=0.0,b=0.0;printf(输入您测得的5组数据:);for(i=0;i5;i++){scanf(%f,&num[i]);}printf(\n输入校准曲线k和b:);scanf(%f%f,&k,&b);printf(=========================================================================================\n);printf(实验次数12345\n);printf(测得的f’);for(i=0;i5;i++){printf(%.1f\t\t,num[i]);}printf(\n);printf(表面张力);BIAOMIANZHANGLI(k,b,num,m);printf(表张系数*E-2);ZHANGlixishu(n,m,a);printf(平均表张*E-2:);PING(a,&k);printf(不确定度*E-2:);BUquedingdu(a,&k);printf(================================================================================================\n);return0;}