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:为什么是wrong answer,请大侠指点

Posted by xfxyjwf at 2005-04-21 12:34:06 on Problem 2105
In Reply To:为什么是wrong answer,请大侠指点 Posted by:00448144 at 2005-04-20 18:59:54
> #include<iostream.h>
> void main()
> {
> 	char array1[33];
> 	int array[33];
> 	int n;
> 	cin>>n;
> 	while(n-->0)
> 	{
> 		int sum1=0,sum2=0,sum3=0,sum4=0;
> 		cin.ignore();
> 	    cin.getline(array1,33);
> 		for(int i=0;i<32;i++)
> 			array[i]=int(array1[i])-48;
> 		sum1=128*array[0]+64*array[1]+32*array[2]+16*array[3]+8*array[4]+4*array[5]+2*array[6]+array[7];
> 		sum2=128*array[8]+64*array[9]+32*array[10]+16*array[11]+8*array[12]+4*array[13]+2*array[14]+array[15];
> 		sum3=128*array[16]+64*array[17]+32*array[18]+16*array[19]+8*array[20]+4*array[21]+2*array[22]+array[23];
> 		sum4=128*array[24]+64*array[25]+32*array[26]+16*array[27]+8*array[28]+4*array[29]+2*array[30]+array[31];
> 		cout<<sum1<<". "<<sum2<<". "<<sum3<<". "<<sum4<<endl;
> 	}
> }
> 

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