3 4 2 6 6 3 4
6 12 No Number
#include <cstdio> #include <iostream> #include <cmath> #include <string> #include <cstring> #include <algorithm> #include <queue> #include <vector> #include <map> using namespace std; #define ll long long int n, x, y; int main() { while(~scanf("%d", &n)) { for(int i = 0; i<n; i++) { scanf("%d%d", &x, &y); if((x+y)%2 == 0) { if((x == y || x-y == 2) && x%2 == 1)printf("%d\n", x+y-1); else if((x == y || x-y == 2) && x%2 == 0)printf("%d\n", x+y); else if(x != y || x-y != 2) printf("No Number\n"); } else printf("No Number\n"); } } return 0; }
原文:https://www.cnblogs.com/RootVount/p/10990690.html