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 kings_zqz at 2007-04-22 13:31:43 on Problem 2105
#include<stdio.h>
#include<math.h>
void main()
{
	int c[33],n,i;
	char a[33];
	int b[4]={0};
	scanf("%d",&n);
	while((n--)!=0)
	{
		for(i=0;i<33;i++)
		{
			a[i]=getchar();
			c[i]=a[i]-'0';
		}
		//for(i=1;i<33;i++)
		//	printf("%d",c[i]);
		for(i=1;i<33;i++)
		
			if(i<9)
				b[0]+=c[i]*(int)pow(2,(8-i));
			else if(i<17&&i>8)
				b[1]+=c[i]*(int)pow(2,(16-i));
				else if(i<25&&i>16)
				b[2]+=c[i]*(int)pow(2,(24-i));
					else if(i<33&&i>24)
				b[3]+=c[i]*(int)pow(2,(32-i));
					for(i=0;i<4;i++)
					{
						printf("%d",b[i]);
						if(i<3) printf(".");
						b[i]=0;
					}
		
					printf("\n");
	}
}

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