POJ 2109 水题 加各种数据类型范围

来源:互联网 发布:从零开始学编程 编辑:程序博客网 时间:2024/06/05 23:04
开始的想法是高精度,但并不是Int16 值类型表示值介于 -32768 到 +32767 之间的有符号整数。Int32 值类型表示值介于 -2,147,483,648 到 +2,147,483,647 之间的有符号整数。Int64 /long 值类型表示值介于 -9,223,372,036,854,775,808 到 +9,223,372,036,854,775,807 之间的整数。 类型 长度 (bit) 有效数字 绝对值范围float 32 6~7 10^(-37) ~  10^38double 64 15~16 10^(-307)   ~   10^308long double 128 18~19 10^(-4931)  ~  10 ^ 4932#include<iostream>#include<string>#include<cmath>#include<algorithm>using namespace std;int main(){    double n,p;    while(scanf("%lf%lf",&n,&p)!=EOF)    {        double k=pow(p,1/n);        printf("%.0lf\n",k);    }    //system("pause");    return 0;}


原创粉丝点击