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

怎么会running error啊

Posted by 3753390 at 2008-08-14 13:37:52 on Problem 2316
#include<stdio.h>
#include<string.h>
int main()
{
        int a[4],b[4];
        char str[6];
        memset(b,0,sizeof(b));
        while(scanf("%s",str)!=EOF)
        {
                 int length=strlen(str);
                 for(int i=0;i<length;++i)
                 a[i]=str[i]-'0';
                 for(int i=0;i<4;++i)
                 {
                          b[i]+=a[i];
                          if(b[i]>=10)
                          b[i]-=10;
                 }
        }
        for(int i=0;i<4;++i)
        {
            printf("%d",b[i]);
        }
        printf("\n");
        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