+ -
当前位置:首页 → 问答吧 → 大家都写一句吧XD

大家都写一句吧XD

时间:2013-05-23

来源:互联网

这个是我自己写的...
复制内容到剪贴板
代码:
#define LOVE true
int main() {
while(LOVE);
return 0;}
而这个是把网友作的诗给翻译XD
复制内容到剪贴板
代码:
#include <algorithm>
#include <iostream>
#include <iterator>
#include <string.h>

struct L
{
char a, tear, c, d[3], future, f;
};
int heart(L &you)
{
you.a = 73;

return 0;
}

class separate
{
public:
void who(char *me)
{
me[0] = 76;
me[1] = 79;
me[2] = 86;
me[3] = 69;
}
};

class Life
{
public:
static char my_heart;
static int treasure(L *you)
{
you->f = my_heart;

return 0;
}
};
char Life::my_heart = 'U';

#define Pain_and_Hate ' '
int main()
{
L you;
memset (&you, 0, sizeof(L));

heart(you);

separate wall;
char &feeling = you.c;
wall.who(&feeling);

Life::treasure(&you);

you.tear = ' ';
you.future = Pain_and_Hate;

std::ostream_iterator<char> out_it (std::cout);
std::copy((char*)&you, (char*)&you + 8, out_it);
std::cout << " forever.\n";

return 0;
}

作者: cheng_chai_fung   发布时间: 2013-05-23

我钟意你个版本,简洁易明。
网友版就「懒」复杂,系编程大忌!
明明可以用 'I' "LOVE",就偏偏要用 ASCII 值。
重有,乜嘢叫 you.tear = ' '; you.future = Pain_and_Hate;?
变数名同内容无关,恕我讲句:「不知所谓。」

作者: fitcat07   发布时间: 2013-05-23

引用:
原帖由 fitcat07 於 2013-5-23 12:23 PM 发表
我钟意你个版本,简洁易明。
网友版就「懒」复杂,系编程大忌!
明明可以用 'I' "LOVE",就偏偏要用 ASCII 值。
重有,乜嘢叫 you.tear = ' '; you.future = Pain_and_Hate;?
变数名同内容无关,恕我讲句 ...
两个都我写的
网友那个是真的有一首诗...我尽可能的在写出来
不过第二篇是玩味性多XD (((其实第二篇写先的



作者: cheng_chai_fung   发布时间: 2013-05-23

不过说...原本写ASCII的原因是因为并非想写ASCII而是unicode的
不过因为在跨平台方面有点难搞所以放弃了

(((果然直接用library才是王道





[ 本帖最后由 cheng_chai_fung 於 2013-5-23 01:03 PM 使用 编辑 ]

作者: cheng_chai_fung   发布时间: 2013-05-23

写program变咗写C, 楼主系得既.

作者: aldonza   发布时间: 2013-05-25

热门下载

更多