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

Re:汗....检查半天,原来 t 被重复使用了....

Posted by ecjtuxsyuan at 2007-10-29 21:17:53 on Problem 2105
In Reply To:改两次了,每次都PE,哪个大牛帮我看看是哪的问题啊. Posted by:ecjtuxsyuan at 2007-10-29 21:02:20
> #include<stdio.h>
> #include<string.h>
> int main()
> {
> 	int t,i,A[4],p,k;
> 	char str[33];
> 	scanf("%d",&t);
> 	while(t--)
> 	{
> 		scanf("%s",str);
> 		memset(A,0,sizeof(A));
> 		t=1;k=3;
> 		for(i=31;i>=0;i--)
> 		{
> 			if(t==1)p=1;
> 			else p*=2;
> 			t++;
> 			if(str[i]=='1')A[k]+=p;
> 			if(t==9){t=1;p=1;k--;}
> 		}
> 		printf("%d.%d.%d.%d\n",A[0],A[1],A[2],A[3]);
> 	}
> 	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