c语言中想要开5次方怎么弄

如题所述

#include <stdio.h>
#include <math.h>
int main()
{
double p, n;
while( scanf("%lf%lf", &n, &p) == 2) //n是开方数,p是要开方的数
printf("%.lf\n", pow(p, 1/n));
return 0;
}


如果楼主你要求的是32的开5次方根,可以输入5 32



PS:若有不明白的地方,可以追问

追问

lf是什么意思?长浮点数??

追答

    lf是什么意思?

        双精度浮点数

追问

用I64f读入呢??

温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-04-07
#include<math.h>
double a_5(double a){
return pow(a,0.2)
}

a_5(a),开a的五次方。

第2个回答  2013-04-07
#include <math.h>

使用pow((double)a, 0.2);

求a^(1/5)即可~~
第3个回答  2013-04-07
有数学库函数,math.h