Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

没有什么意思!

Posted by chenxuan123456789 at 2012-07-30 13:38:39 on Problem 1423
#include<stdio.h>
int main()
{
	int n,m,i,bit=1;
	double num=0;
	scanf("%d",&n);
	while(n--)
	{
		bit=1,num=1;
		scanf("%d",&m);
		for(i=2;i<=m;i++)
		{
			num*=i;
			if(num<10){continue;}
			if(num<100){num/=10;bit+=1;continue;}
			if(num<1000){num/=100;bit+=2;continue;}
			if(num<10000){num/=1000;bit+=3;continue;}
			if(num<100000){num/=10000;bit+=4;continue;}
			if(num<1000000){num/=100000;bit+=5;continue;}
			if(num<10000000){num/=1000000;bit+=6;continue;}
			if(num<100000000){num/=10000000;bit+=7;continue;}
		}
		printf("%d\n",bit);
	}
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator