题目链接:http://acm.tju.edu.cn/toj/showp1777.html
Time Limit: 1.0 Seconds Memory Limit: 65536K
Total Runs: 692 Accepted Runs: 402

Amtel will use a new benchmark - the Factstone - to advertise the vastly improved capacity of its new chips. The Factstone rating is defined to be the largest integer n such that n! can be represented as an unsigned integer in a computer word.
Given a year 1960 ≤ y ≤ 2160, what will be the Factstone rating of Amtel's most recently released chip?
There are several test cases. For each test case, there is one line of input containing y. A line containing 0 follows the last test case. For each test case, output a line giving the Factstone rating.
Sample Input
1960 1981 0
Sample Output
3 8
Source: Waterloo Local Contest Sep. 24, 2005
题目链接:http://poj.org/problem?id=2661
利用:
2^n<1*2*3...m
n<log21+log22+log23.....然后换底公式
代码:
#include <stdio.h>
#include <cmath>
using namespace std;
int main(){
int n,i;
while(~scanf("%d",&n),n){
double tmp=pow(2.0,((n-1960)/10+2));
double sum=0;
for(i=1;tmp>sum;i++)
sum+=log(1.0*i)/log(2.0);
printf("%d\n",i-2);
}
}