class Hand {
enum Shape{GUU,CHOKI,PAA};
Shape shape;
public:
bool winsOver(const Hand &opponent)const{
switch(shape){
case GUU: return opponent.shape==CHOKI;
case CHOKI: return opponent.shape==PAA;
case PAA: return opponent.shape==GUU;
}
}
};
こんな感じでひとつ