谁说IT男找不到女票!劳资写一段代码告诉你,IT男要女票还不是分分钟的事!只要不死,一天换一个,而且有着年芳十八,有车有房,父母双亡的标准动漫设定~
看代码~
#include <iostream>
#include <windows.h>
using namespace std;
#define ONE_DAY (86400 * 1000)//一天的秒数
class GirlFriend
{
public:
GirlFriend *thisGirl(){return this;}
void haveCars(){
cout << "This girl has a lots of cars ~~" << endl;
}
void haveMoney(){
cout << "This girl is fabulously rich" << endl;
}
void noParents(){
cout << "Her parents passed away when she was very young" << endl;
}
GirlFriend(int old = 18){
thisGirl()->old = old;
cout << "this girl is " << this->old << " years old~" << endl;
thisGirl()->haveCars();
thisGirl()->haveMoney();
thisGirl()->noParents();
cout << "Most important thing is that she is your girlfrend!!!" << endl;
}
~GirlFriend(){
cout << "The girl being dumped by you~~" << endl;
}
protected:
private:
int old;
};
int main()
{
while (1)
{
GirlFriend *gf = new GirlFriend();//创建新女友
Sleep(ONE_DAY);//睡眠一天
delete gf;//删除
}
return 0;
}