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> #include<stdlib.h> void main() { int n; int *x,*y; int i=0; scanf("%d",&n); x=(int *)malloc(n*sizeof(int)); y=(int *)malloc(n*sizeof(int)); for(i=0;i<n;i++) { fflush(stdin); scanf("%d %d",&x[i],&y[i]); } for(i=0;i<n;i++) { if(x[i]!=y[i]&&x[i]!=y[i]+2) printf("No Number\n"); if(x[i]==y[i]) { if(x[i]%2==0) printf("%d\n",(x[i]/2)*4); else if(x[i]%2==1) printf("%d\n",(x[i]/2)*4+1); } else if(x[i]==y[i]+2) { if(y[i]%2==0) printf("%d\n",(y[i]/2)*4+2); else if(y[i]%2==1) printf("%d\n",(y[i]/2)*4+3); } } } 为什么wa啊?给祭祖错误数据也好啊....... 谢谢谢谢......... Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator