#include <stdio.h>
#include <math.h>
int main() {
double base = 10; // 设置底数为10
double exponent = -100; // 设置指数为3
while(1)
{
printf("输入V:");
scanf("%lf",&exponent);
printf("为%lfV 或 %lfmV\n",exponent,exponent*1000);
printf("结果为:%lf dB 或 %lf dBm\n", 20*log(exponent)/log(10), 20*log(exponent*1000)/log(10));
}
scanf("%lf",&exponent);
return 0;
}
C语言输入电压(V)计算分贝(dB/dBm)
于 2024-02-28 10:00:42 首次发布