10916 - Factstone Benchmark

来源:互联网 发布:u盘黑苹果windows 编辑:程序博客网 时间:2024/05/18 15:57
#include <iostream>#include <cmath>using namespace std;int main(){    int y,i,x(4);    double count;    while(cin>>y)    {        if(y==0)break;        y=(y-1960)/10;        for(i=0; i<y; i++)            x=x*2;        count=0;        for(i=1;; i++)        {            count+=log(i);            if(count>=(double)x*log(2))break;        }        cout<<i-1<<endl;        x=4;    }    return 0;}

原创粉丝点击