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 shukuiyan at 2007-06-05 12:27:16 on Problem 2105
#include "stdio.h"

void main()
{ int n,i,j,sum;
char s[4][8];
  int a[8]={128,64,32,16,8,4,2,1};
 
    scanf("%d",&n);
  getchar();
  while(n--)
  { for(i=0;i<=3;i++)
       for(j=0;j<=7;j++)
	  	   
	   scanf("%c",&s[i][j]);
	   
	   
    
    for(i=0;i<=3;i++)
	   {	sum=0;
		for(j=0;j<=7;j++)
		if(s[i][j]=='1')  sum+=a[j];
		if(i<3)  printf("%d.",sum);
                  else   printf("%d\n",sum);
	}
  }


	
}

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