Finding Bovine Roots

来源:互联网 发布:最新短期网络投资理财 编辑:程序博客网 时间:2024/06/08 14:56
#include <stdio.h>
#include <math.h>


const double theE[] ={1,1e-1,1e-2,1e-3,1e-4,1e-5,1e-6,1e-7,1e-8,1e-9};


int main()
{
double t1;
double t2;
int c,n;
scanf("%d",&c);
scanf("%d",&n);

double flo = n*theE[c];
int now=1;
while(1)
{
t1 = (long long)(pow(now+flo,2))+1;
t2 = pow(now+flo+theE[c],2);
if(t2>t1)
break;
now++;
}
    printf("%lld\n",(long long)t1);

}


//思路:

//longlong的输出格式

原创粉丝点击