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

error

Posted by 241 at 2009-07-13 11:44:41
#include<stdio.h>
#include<string.h>

int main ()
{
	int i,j,k,sum,t,n;
	char s[32];
	scanf("%d",&n);
	for(k=0;k<n;k++){
    getchar();
	gets(s);
	for(i=0;i<4;i++){
	t=128;sum=0;
	for(j=i*8;j<(i+1)*8;j++)
	{
	
		if(s[j]=='1')  sum+=t;
			t/=2;
	}
	if(i==3) printf("%d\n",sum);
	else printf("%d.",sum);
	
	}
	}
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