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 tcxgsy at 2005-09-10 13:56:30 on Problem 2602
#define max 1000001
#include"stdio.h"


void main()
{  long n,i,j;
   int a[max][2],b[max]={0};
   
   scanf("%ld",&n);
    for(i=0;i<n;i++)
        {scanf("%d%d",&a[i][0],&a[i][1]);
        b[i]=a[i][0]+a[i][1];}
     for(i=n-1;i>0;i--)
         if(b[i]>=10)  {b[i-1]+=1;b[i]=b[i]%10;}
    for(i=0;i<n;i++)
     printf("%d",b[i]);
    printf("\n");
  
}

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