UVA 133 Power of Cryptography 。。。其实很简单

来源:互联网 发布:神话情话知乎 编辑:程序博客网 时间:2024/05/22 06:06

UVA 133  Power of Cryptography

一眼看上去像是高精度。 其实仔细看题目,只到100多位。完全可以用double来做,最后强制类型转换成int就可以了
代码就几行。 非常水。。。。

#include <stdio.h>#include <string.h>#include <math.h>double n, p;double k;int main(){    while (scanf("%lf%lf", &n, &p)!= EOF)    {printf("%d\n", int (pow(p, 1/n) + 0.5));       }    return 0;}


原创粉丝点击