c++编写爱情诗歌

  1. /* ******************************************* 
  2. ***** File Name:    Love.c 
  3. ***** Description:  Love Story about you and me 
  4. ***** Author:       JPing.Cai 
  5. ***** Date:         2014-5-10 
  6. ***** Last Version: 1.0 
  7. * *******************************************/  
  8.   
  9. #include <stdio.h>  
  10.   
  11.   
  12. struct Position {  
  13.     bool isEqual(Position p) {}  
  14.   
  15.     void together(Position &p) {}  
  16. };  
  17.   
  18. struct Hand {  
  19.     void hold(Hand &hand, int time) {}  
  20. };  
  21.   
  22. struct Arms {  
  23.     Position between() {}  
  24. };  
  25.   
  26. struct Heart {  
  27.     Position position;  
  28. };  
  29.   
  30. struct Person {  
  31.     Position position;  
  32.     Hand hand;  
  33.     Arms arms;  
  34.     Heart heart;  
  35.   
  36.     struct Emotion {  
  37.         int happiness;  
  38.   
  39.         struct Love {  
  40.             Person *who;  
  41.             int deep;  
  42.         }love;  
  43.   
  44.         Person *hostPerson;  
  45.   
  46.         Emotion(Person *p):hostPerson(p) {}  
  47.     }emotion;  
  48.       
  49.   
  50.     bool meet(Person &p) {}  
  51.   
  52.     bool miss(Person &p) {}  
  53.   
  54.     bool love(Person &p) {}  
  55.   
  56.     bool follow(Person &p) {}  
  57.   
  58.     Person():emotion(this) {}  
  59.     void is(Person &p) {}  
  60. };  
  61.   
  62.   
  63. #define FOREVER_LOVE 10000  
  64. #define FOREVER true  
  65.   
  66. int main(int argc, char const *argv[])  
  67. {  
  68.     Person you, me;  
  69.   
  70.     /* the person who I love is you */  
  71.     me.emotion.love.who->is(you);  
  72.   
  73.     /* the person who you love is me */  
  74.     you.emotion.love.who->is(me);  
  75.   
  76.   
  77.     /*  
  78.         whether you meet me or not 
  79.         I am here, not sad, not happy 
  80.      */  
  81.     if (you.meet(me) || !you.meet(me)) {  
  82.         me.emotion.happiness++;  
  83.         me.emotion.happiness--;  
  84.     }  
  85.   
  86.     /* 
  87.         whether you miss me or not 
  88.         Emotion is there, not come, not go 
  89.     */  
  90.     if (you.miss(me) || !you.meet(me)) {  
  91.         me.emotion;  
  92.         you.emotion;  
  93.     }  
  94.   
  95.     /* 
  96.         whether you love me or not 
  97.         Love is there, not increase, not reduce 
  98.     */  
  99.     if (you.love(me) || !you.love(me)) {  
  100.         me.emotion.love.deep++;  
  101.         me.emotion.love.deep--;  
  102.     }  
  103.   
  104.     /* 
  105.         whether you follow me or not 
  106.         My hands is in yours, never let go 
  107.     */  
  108.     if (you.follow(me) || !you.follow(me)) {  
  109.         me.hand.hold(you.hand, FOREVER_LOVE);  
  110.     }  
  111.   
  112.     /* 
  113.         Come to my arms, 
  114.         or, let me live in your heart, 
  115.         silence, love, quietness, gladness 
  116.     */  
  117.     do {  
  118.         if (you.position.isEqual(me.arms.between())) continue;  
  119.         else me.position.together(you.heart.position);  
  120.         me.emotion.love.deep = you.emotion.love.deep = FOREVER_LOVE;  
  121.     } while(FOREVER);  
  122.   
  123.     return 0;  

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值