Power of Cryptography 数学题 注意double能表示的最大范围

来源:互联网 发布:慈溪行知职高 编辑:程序博客网 时间:2024/05/16 08:18
/*整型           int         -2*10^9 ~ 2*10^9单精度型   float       -3.4*10^38 ~ 3.4*10^38双精度型   double    -1.7*10^308 ~ 1.7*10^308*/#include <stdio.h>#include <math.h>int main(){    double n,x;    while (scanf("%lf%lf",&n,&x)!=EOF) printf("%.0f\n",pow(x,1.0/n));    return 0;}


原创粉丝点击