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 |
show my code,没有打表#include<iostream> #include<cmath> #include<cstring> #include<string> #include<algorithm> using namespace std; int main() { int n; cin>>n; while(n--) { int x,y; cin>>x>>y; int sum=x+y; if(x==y) { if(sum%4==0) cout<<sum<<endl; else cout<<sum-1<<endl; } else if(x==y+2) { if(sum%4==0) cout<<sum-1<<endl; else cout<<sum<<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