| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
郁闷!! 为什么#include"stdio.h"
main()
{
int n,s,d,i;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%d",&s,&d);
if((s-d>=0)&&((s-d)%2==0)&&((s+d)%2==0))
printf("%d %d\n",(s+d)/2,(s-d)/2);
else
printf("impossible\n");
}
}能过,可是下面的却不能过!!明明s+d>0多余的条件,对结果没有影响,却过不了!!!
#include"stdio.h"
main()
{
int n,s,d,i;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%d",&s,&d);
if((s-d>=0)&&((s-d)%2==0)&&((s+d)%2==0)&&((a+b)>0))
printf("%d %d\n",(s+d)/2,(s-d)/2);
else
printf("impossible\n");
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator