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

为什么一直w呢,大牛帮忙一下;

Posted by 286704851 at 2008-05-31 09:10:34 on Problem 2105
#include<stdio.h>

int main()
{
 int time,i,j,sum;
 char str[32];
  scanf("%d",&time);
  for(i=0;i<time;i++)
  {
   scanf("%s",str);
   for( j=0;j<3;j++)
   {
    sum=0;
   
    sum=(str[j*8]-'0')*128+(str[j*8+1]-'0')*64+(str[j*8+2]-'0')*32+(str[j*8+3]-'0')*16+(str[j*8+4]-'0')*8+(str[j*8+5]-'0')*4+(str[j*8+6]-'0')*2+(str[j*8+7]-'0');
    printf("%d.",sum);
   }
   sum=0;
  sum=(str[3*8]-'0')*128+(str[3*8+1]-'0')*64+(str[3*8+2]-'0')*32+(str[3*8+3]-'0')*16+(str[3*8+4]-'0')*8+(str[3*8+5]-'0')*4+(str[3*8+6]-'0')*2+(str[3*8+7]-'0');
    printf("%d\n",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