c语言 一个关于年增长率的题 x是年增长率 n是年数。(1+x)^n=2 输入n年数 求x年增长率 感谢大佬
#include <stdio.h> #include <math.h> int main() { int n; double x; scanf("%d",&n); x = pow(2,1.0/n)-1; printf("%lf",x); return 0; }