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 for_love at 2007-06-11 19:26:12 on Problem 2665
高手认为这道题我们应该注意些什么呢??为什么我的这个代码就不通呢???
#include<stdio.h>
void main()
{
    long l,s,sum;long i, m,a[1000][2];
    scanf("%d %d",&l,&m);
    while(l!=0&&m!=0)
    {
      sum=0;
      s=0;
      for(i=0;i<m;i++)
      {
	scanf("%d %d",&a[i][0],&a[i][1]);
      }
      for(i=0;i<m;i++)
      s=a[i][1]-a[i][0]+s+1;
     sum=l+1-s;
     printf("%d\n",sum);
     scanf("%d %d",&l,&m);
    }
}

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