#include <iostream>
#include <cstring>
using namespace std;

enum YesOrNo {no,yes};
enum color {red, yellow, green, orange};
void out(YesOrNo x);
char *colorNames[] = {
	"赤","黄","緑","オレンジ"};

class fruit {
public:
	YesOrNo annual;
	YesOrNo perennial;
	YesOrNo tree;
	YesOrNo tropical;
	color clr;
	char name[40];
};

class Apple : public fruit {
	YesOrNo cooking;
	YesOrNo crunchy;
	YesOrNo eating;
public:
	void seta(char *n,color c,YesOrNo ck, YesOrNo crchy, YesOrNo e);
	void show();
};

class Orange : public fruit {
	YesOrNo juice;
	YesOrNo sour;
	YesOrNo eating;
public:
	void seto(char *n,color c, YesOrNo j, YesOrNo sr, YesOrNo e);
	void show();
};

void Apple::seta(char *n,color c,YesOrNo ck, YesOrNo crchy, YesOrNo e)
{
	strcpy(name, n);
	annual = no;
	perennial = yes;
	tropical = no;
	clr = c;
	cooking = ck;
	crunchy = crchy;
	eating = e;
}

void Orange::seto(char *n,color c, YesOrNo j, YesOrNo sr, YesOrNo e)
{
	strcpy(name, n);
	annual = no;
	perennial = yes;
	tree = yes;
	tropical = yes;
	clr = c;
	juice = j;
	sour = sr;
	eating = e;
}

void Apple::show()
{
	cout << name << "リンゴ: " << "\n";
	cout << "一年生植物:"; out(annual);
	cout << "多年生植物:"; out(perennial);
	cout << "木:"; out(tree);
	cout << "熱帯性:"; out(tropical);
	cout << "色:" << colorNames[clr] << "\n";
	cout << "料理用:" ; out(cooking);
	cout << "かたい:" ; out(crunchy);
	cout << "食用:" ; out(eating);
	cout << "\n";
}

void Orange::show()
{
	cout << name << "オレンジ: " << "\n";
	cout << "一年生植物:"; out(annual);
	cout << "多年生植物:"; out(perennial);
	cout << "木:"; out(tree);
	cout << "熱帯性:"; out(tropical);
	cout << "色:" << colorNames[clr] << "\n";
	cout << "ジュース用:"; out(juice);
	cout << "酸っぱい:"; out(sour);
	cout << "食用:"; out(eating);
	cout << "\n";
}

void out(YesOrNo x)
{
	if (x == no){
		cout << "no\n";
	}
	else {
		cout << "yes\n";
	}
}

int main()
{
	Apple a1,a2;
	Orange o1, o2;
	
	a1.seta("レッドデリシャス", red, no, yes, yes);
	a2.seta("ジョナサン", red, yes, no, yes);
	
	o1.seto("ネーブル", orange, no, no, yes);
	o2.seto("バレンシア", orange, yes, yes, no);
	
	a1.show();
	a2.show();
	
	o1.show();
	o2.show();
	
	return 0;
}

	