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 |
我的写的虽然有点麻烦但运行绝对没有问题,但为什么就是WA????#include<iostream.h> int main() { int N,x,y,p; cin>>N; for(int i=1;i<=N;i++) { cin>>x>>y; if(x==y) { if(x%2==0) p=2*x; else p=2*x+1; cout<<p<<endl; } else if((x-y)==2&&x>=2) { if(x%2==0) p=2*x-2; else p=2*x-3; cout<<p<<endl; } else cout<<"No Number"<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator