代码爱情

类别:软件工程 点击:0 评论:0 推荐:

国庆节去看女友,由于一些其他事务在身,竟空手去看女友,此大忌也,更何况还尚有一信未回.归来后,她牢骚四起,心感愧疚,故写此代码以示补尝(此c#代码可直接运行)

 //****************************************************************
//*  LoveCabin.cs                                                *                                 
//*  Copyright 2004 by SuperCode <[email protected]>             *
//*  All Rights Reserved.                                        *
//*                                                              *
//*  Purpose: Write For My GirlFriend                            *
//*  Author:  登峰(SuperCode)                                    *
//*  Date:    2004/10/6                                          *
//****************************************************************

using System;

namespace LoveCabinForKornyClaire
{
 
 class LoveCabin
 {
  private static string MaleHost;
  private static string FemaleHost;

  public LoveCabin(string setMaleHost,string setFemaleHost)
  {
   //虽然有一俊男靓女想进入爱情小屋
   //但是爱情小屋的男女主人永远是Korny和Claire
   MaleHost="SuperCode";
   FemaleHost="Claire";
           
   //为两人的坚强,献上诗一首
   DevoteAPoem();

   //平时很难开口说爱你一万遍,但现在可以了
   SayLoveYouRepeatTenThousand();

   //两个永远在一起的秘决是什么呢?
   DoItAlways();
 

  }//end LoveCabin

  private void DevoteAPoem()
  {
           
    string [] Poems=new string[] {  "我记得那神奇的瞬间",
            "在我的面前出现了你",
            "就像昙花一现的幻像",
              "就像纯洁之美的精灵",
              "在无望忧愁的折磨中",
              "在喧闹生活的纷扰里",
              "温柔的声久久对我回响",
              "可爱的脸庞浮现在梦里"};
    for(int i=0;i<Poems.Length;i++)
    {
     if(i==4)Console.WriteLine("");//把诗分段(空行)
     Console.WriteLine(Poems[i]);
    }


  }//end DevoteAPoem

  
  private void SayLoveYouRepeatTenThousand()
  {
    int counts=1;
    while(counts   <= 10*1000)
    {
     Console.WriteLine("I Love You ! ");
     counts++;
    }

  }//end SayLoveYouRepeatTenThousand


  private void DoItAlways()
  {
    string [] Persons=new string[] {MaleHost,FemaleHost};
    int bit=0;
     
    while(true)
    {
     string OutStr=Persons[bit]+" Love "+  Persons[(bit+1)%2];     
     Console.WriteLine(OutStr);
     bit=(++bit)%2;

    }

  }//DoItAlways

 

 }//end LoveCabin

 

 class RealisticWorld
 {

    [STAThread]
    static void Main(string[] args)
    {
     //有一俊男靓女想进入爱情小屋
     string man="aHandSomeMan";
     string woman="aComeLinessGirl";
     LoveCabin lc=new LoveCabin(man,woman);
       
    } //end Main

 }//end RealisticWorld

}//end namespace

本文地址:http://com.8s8s.com/it/it35248.htm