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 Time error

Posted by 00846086 at 2009-01-31 15:26:57 on Problem 2602
#include "stdio.h"
int main()
{
        long n;
        int a[100004]={0},b,c;
        long i;

        scanf("%ld",&n);
        for(i=0;i<n;i++){
                scanf("%d%d",&b,&c);
                a[i]=b+c;
        }
        for(i=n-1;i>0;i--){
                if(a[i]>9){
                        a[i-1]++;
                        a[i]%=10;
                }
        }
        printf("%d",a[0]%10);
        for(i=1;i<n;i++)
                printf("%d",a[i]);
        putchar('\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