实在不想一个个敲计算器便随手写了段代码,方便大家编造数据用(bushi)
tip:
公式为学校实验室黑板公式,与书上略有出入
两个版本的区别是python版本可以一次算一组五次的全部数据,并求出了相对误差
C语言版本
#include<stdio.h>
#include<math.h>
int main()
{
int u,n1;
float d=0.005,n=0.0000183,s=0.0016,p1=981,p2=1.2928,g=9.8015,b=0.00823,p=101325;
float x,y,z,w,v,q,e,t,n0;
printf("输入电压和时间\n") ;
scanf("%d%f",&u,&t) ;
x=sqrt<