猫と犬のラブゲーム2

2052 ワード

//   5          2
#include
#include 
#include 
#include 
using namespace std;
class Boy
{
	public:
	bool House; //  ;
	int Age; //  ;
	char Name[20];
	public:
	Boy(char *name);
	bool Gift(char gift);
	int AnnualSalary(int salary);
};
Boy::Boy(char *name)
{
	srand((unsigned)time(NULL));		//  rand()           
	if(rand() == 100) House=true;
	strcpy(Name,name);
}
bool Boy::Gift(char gift)
{
	if(gift=='Y'||gift=='y')
	return true;
	else
	return false;
}
int Boy::AnnualSalary(int salary)
{
	cout<days[i])
		{
			day=day-days[i];
		}
		else
		{
			break;
		}
	}
	return ((i+1)*100+day);
}
int main( )
{
	Boy theBoy("dog");
	Girl theGirl("cat");
	theBoy.Age=24;
	theGirl.Feeling=1;
	theGirl.Willing=true;
	theGirl.Birthday=1001;
	int year=1;
	char gift='N';
	int money=0;
	int salary=0;
	theGirl.Love(theBoy.Name ); //    
	if(theBoy.House == true)
	{
		theGirl.Marry(theBoy.Name);
		return 0;
	}
	while(theGirl.Willing==true)
	{
		cout<>gift;
				if( theBoy.Gift(gift))
					theGirl.Feeling++;
				else
					theGirl.Feeling--;
			}
			if( convertDate(day) == theGirl.Birthday) //if (     (day) == theGirl.Birthday)
			{
				cout<>gift;
				if( theBoy.Gift(gift))
					theGirl.Feeling++;
				else
					theGirl.Feeling--;
			}
		}
		cout<>salary;
		money=money+theBoy.AnnualSalary(salary);
		cout<1000000)
		{
			theBoy.House=true;
			break;
		}
		year++;
		theBoy.Age++;
		theGirl.Feeling--;
		if(theBoy.Age>30 || theGirl.Feeling<0) theGirl.Willing=false;
	}
	if(theBoy.House==true)
		theGirl.Marry(theBoy.Name);
	else
	{
		Boy anotherBoy("Mouse");
		theGirl.Love(anotherBoy.Name);
	}
	return 0;
}