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

Re:这水好怪异。。明明说不能超过5000,开始都加了这条件。。一直WA,把那条件移除。AC。。怪异~~

Posted by 09301144 at 2011-05-01 20:38:57 on Problem 1663
In Reply To:这水好怪异。。明明说不能超过5000,开始都加了这条件。。一直WA,把那条件移除。AC。。怪异~~ Posted by:NARUTOACM at 2009-09-11 21:42:44
#include<stdio.h>
main()
{
  int i;
  int j;
  int a,b;
  int result;
  scanf("%d",&i);
  for(j=0;j<i;j++)
    {
      scanf("%d %d",&a,&b);
      if(a==b)
        {
            if(a%2==0)
              {
                result=2*a;    
              }             
            else
              {
                result=2*a-1;              
              }
           printf("%d\n",result);
        }
      if(a-b==2)
        {
           if(a%2==0)
             {
               result=2*a-2;        
             }     
           else
             {
               result=2*a-3;      
             }
           printf("%d\n",result);
        }
      if(a!=b&&a-b!=2)
        {
          printf("No Number\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