题目链接
http://acm.hdu.edu.cn/showproblem.php?pid=2147
解题思路
AC代码
#include<bits/stdc++.h>
using namespace std;
const int B=2005;
bool mp[B][B];
int main(){
int n,m;
for(int i=B-5;i>=1;i--)
for(int j=1;j<=B-5;j++){
if((i&1)&&(j&1)) mp[i][j]=1;//i与j同为奇数时
}
while(cin>>n>>m&&n&&m){
if(mp[n][m]) cout<<"What a pity!"<<endl;
else cout<<"Wonderful!"<<endl;
}
} 
京公网安备 11010502036488号