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

Help?Help?So serious accident!Why wa?高人指教!

Posted by yulai251752 at 2006-03-18 13:50:59 on Problem 1565
#include<stdio.h>
int main()
{
	  __int64 i=1,j,k,sum=0,total=1;char s[32];char c;
	while((c=getchar())!='0')
	{
		s[0]=c;
		while((c=getchar())!='\n')
	s[i++]=c;
	s[i]='\0';
	for(j=0;j<i;j++)
	{
		s[j]-=48;
		for(k=0;k<i-j;k++)
		{
			total*=2;
			}
		s[j]=s[j]*total-s[j];
	/*	s[j]=(long int)ldexp((double)s[j],i-j)-s[j];*/
		sum+=s[j];
		total=1;
		}
		printf("%I64d\n",sum);
		i=1;
		sum=0;
		}
		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