这纯粹找规律。。。找数字与X Y坐标之间的关系捏。。 刚开始想得还挺麻烦滴。。。 数学好伟大!再感慨下~ #include <iostream> using namespace std; int main(void) { int x,y,ncases; cin>>ncases; while(ncases--) { cin>>x>>y; if( x-y == 2 || x == y) { if( x == y ) { if(x%2 == 0) cout<<2*x<<endl; else cout<<2*x-1<<endl; } else { if(x%2 == 0) cout<<x+y<<endl; else cout<<x+y-1<<endl; } } else cout<<"No Number"<<endl; } system("pause"); return 0; }