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 |
Re:郁闷!!In Reply To:郁闷!! Posted by:mingjiereng at 2010-05-28 20:03:15 > 为什么#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