當前位置:編程學習大全網 - 電腦編程 - 大神幫忙用c語言編壹個程序計算壹個物理公式

大神幫忙用c語言編壹個程序計算壹個物理公式

#include <stdio.h>

#include <math.h>

int main(){

double b,u,n,i,r,x;

u=4.0*3.1416*1E-07;

n=500.0;

i=500.0;

printf("input r:\n"); scanf("%lf", &r);

printf("input x:\n"); scanf("%lf", &x);

b = (u*r*r*n*i)/2.0/ pow(r*r+x*x,1.5);

printf("b=%lf", b);

return 0;

}

輸入 110 和 0

輸出 b=0.001428

請註意物理量的單位,根據單位,自己調整壹下程序。

pow() 是 冪函數計算。

  • 上一篇:開發壹個移動智能家居app要多少錢?
  • 下一篇:C語言數據類型中的“雙精度”和“單精度”是什麽意思?
  • copyright 2024編程學習大全網