c++编写爱情诗歌
2015-12-09 12:10
375 查看
[cpp]
view plaincopyprint?
/* *******************************************
***** File Name: Love.c
***** Description: Love Story about you and me
***** Author: JPing.Cai
***** Date: 2014-5-10
***** Last Version: 1.0
* *******************************************/
#include <stdio.h>
struct Position {
bool isEqual(Position p) {}
void together(Position &p) {}
};
struct Hand {
void hold(Hand &hand, int time) {}
};
struct Arms {
Position between() {}
};
struct Heart {
Position position;
};
struct Person {
Position position;
Hand hand;
Arms arms;
Heart heart;
struct Emotion {
int happiness;
struct Love {
Person *who;
int deep;
}love;
Person *hostPerson;
Emotion(Person *p):hostPerson(p) {}
}emotion;
bool meet(Person &p) {}
bool miss(Person &p) {}
bool love(Person &p) {}
bool follow(Person &p) {}
Person():emotion(this) {}
void is(Person &p) {}
};
#define FOREVER_LOVE 10000
#define FOREVER true
int main(int argc, char const *argv[])
{
Person you, me;
/* the person who I love is you */
me.emotion.love.who->is(you);
/* the person who you love is me */
you.emotion.love.who->is(me);
/*
whether you meet me or not
I am here, not sad, not happy
*/
if (you.meet(me) || !you.meet(me)) {
me.emotion.happiness++;
me.emotion.happiness--;
}
/*
whether you miss me or not
Emotion is there, not come, not go
*/
if (you.miss(me) || !you.meet(me)) {
me.emotion;
you.emotion;
}
/*
whether you love me or not
Love is there, not increase, not reduce
*/
if (you.love(me) || !you.love(me)) {
me.emotion.love.deep++;
me.emotion.love.deep--;
}
/*
whether you follow me or not
My hands is in yours, never let go
*/
if (you.follow(me) || !you.follow(me)) {
me.hand.hold(you.hand, FOREVER_LOVE);
}
/*
Come to my arms,
or, let me live in your heart,
silence, love, quietness, gladness
*/
do {
if (you.position.isEqual(me.arms.between())) continue;
else me.position.together(you.heart.position);
me.emotion.love.deep = you.emotion.love.deep = FOREVER_LOVE;
} while(FOREVER);
return 0;
}
view plaincopyprint?
/* *******************************************
***** File Name: Love.c
***** Description: Love Story about you and me
***** Author: JPing.Cai
***** Date: 2014-5-10
***** Last Version: 1.0
* *******************************************/
#include <stdio.h>
struct Position {
bool isEqual(Position p) {}
void together(Position &p) {}
};
struct Hand {
void hold(Hand &hand, int time) {}
};
struct Arms {
Position between() {}
};
struct Heart {
Position position;
};
struct Person {
Position position;
Hand hand;
Arms arms;
Heart heart;
struct Emotion {
int happiness;
struct Love {
Person *who;
int deep;
}love;
Person *hostPerson;
Emotion(Person *p):hostPerson(p) {}
}emotion;
bool meet(Person &p) {}
bool miss(Person &p) {}
bool love(Person &p) {}
bool follow(Person &p) {}
Person():emotion(this) {}
void is(Person &p) {}
};
#define FOREVER_LOVE 10000
#define FOREVER true
int main(int argc, char const *argv[])
{
Person you, me;
/* the person who I love is you */
me.emotion.love.who->is(you);
/* the person who you love is me */
you.emotion.love.who->is(me);
/*
whether you meet me or not
I am here, not sad, not happy
*/
if (you.meet(me) || !you.meet(me)) {
me.emotion.happiness++;
me.emotion.happiness--;
}
/*
whether you miss me or not
Emotion is there, not come, not go
*/
if (you.miss(me) || !you.meet(me)) {
me.emotion;
you.emotion;
}
/*
whether you love me or not
Love is there, not increase, not reduce
*/
if (you.love(me) || !you.love(me)) {
me.emotion.love.deep++;
me.emotion.love.deep--;
}
/*
whether you follow me or not
My hands is in yours, never let go
*/
if (you.follow(me) || !you.follow(me)) {
me.hand.hold(you.hand, FOREVER_LOVE);
}
/*
Come to my arms,
or, let me live in your heart,
silence, love, quietness, gladness
*/
do {
if (you.position.isEqual(me.arms.between())) continue;
else me.position.together(you.heart.position);
me.emotion.love.deep = you.emotion.love.deep = FOREVER_LOVE;
} while(FOREVER);
return 0;
}
相关文章推荐
- C++使用protobuf传输中间包含\0的字节数组
- Memento(备忘录)设计模式
- C++中map的常用方法
- c++_4: 多态_1_虚函数的定义
- C++异常机制的实现方式和开销分析
- C++ 操作 MySQL
- C语言总结
- 【离散数学】实验四 图的随机生成及欧拉(回)路的确定
- 黑马程序员——C语言——文件读写
- 初来乍到之辛酸菜鸟
- 跟我一起玩Win32开发(1):关于C++的几个要点
- C语言结构类型
- Remove Element
- Remove Element
- 《C语言综合研究第2章宣讲会研究报告_20130610_v1.0》 2.docx
- 《C语言综合研究第1章宣讲会研究报告_20130609_v1.0》
- dev-c++ 添加boost库
- C++强大的背后(二)
- C++强大的背后(一)
- VC++中List Control控件的使用方法介绍