您的位置:首页 > 其它

poj2661 Factstone Benchmark 数学

2014-05-12 21:29 281 查看
题目链接:http://poj.org/problem?id=2661

吴永辉《算法设计编程实验》1.1.1

///2014.4.12
///poj2661

#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
using namespace std;

int main()
{
// freopen("in","r",stdin);
// freopen("out","w",stdout);

int a;
while( cin>>a && a ){
int k = 4;
for(int i=1960 ; i/10<a/10 ; i+=10)
k *= 2;
int n=1;
double sum = 0;
for(n=1 ; sum<k ; n++){
sum += log( (double)n )/log( (double)2 );
}
n -= 2;
cout<<n<<endl;
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: