Skip to content

Instantly share code, notes, and snippets.

@dd1994
Created November 25, 2013 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dd1994/7637476 to your computer and use it in GitHub Desktop.
Save dd1994/7637476 to your computer and use it in GitHub Desktop.
物理实验报告“霍尔效应”的一道麻烦算数题 -std=c99
#include <stdio.h>
double f(double);
int main(int argc, char const *argv[])
{
double u[17] = {4.115, 5.88, 6.79, 7.2275, 7.745, 7.83, 7.8425, 7.9025, 7.8925, 7.8525, 7.84, 7.8225, 7.455, 7.165, 6.6, 5.39, 3.5115};
for (int i = 0; i < 17; ++i)
{
printf("%.3f\n",f(u[i]) );
}
return 0;
}
double f(double u)
{
double i = 4.00;
double k =18.5;
double b;
b = u/(k*i);
return b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment