情人节用短代码寄托下感情吧
之前光棍节看到有人写代码寄托感情,觉得挺好玩的,今天弄个帖子,来供各位代码达人休闲娱乐下下,寄托下感情,嘿嘿,小弟不才,先来吧...
爱的永恒-----内存泄漏的那一刻,我依然爱你
#include <iostream>
using namespace std;
int main(void)
{
LOVE * pLove = new LOVE;
return 0;
}
因为爱你,内存泄漏,因为爱你,不舍得释放...
[解决办法]
#include <stdio.h>
#include <stdlib.h>typedef char LOVE;int main(){ LOVE * love = (LOVE *)malloc(sizeof(LOVE)); while(love){}; // 没有爱的空间就释放吧! return 0;}
[解决办法]
if (true == YouHaveLover()){ PlayMusic("情人节快乐 -- 张振宇.mp3");}else{ PlayMusic("没有情人的情人节 -- 孟庭苇.mp3");}
[解决办法]
#include <iostream>using namespace std;int main(){ for (unsigned char times = 0; times <= 255; ++times) { cout << "我爱你!" << endl; } return 0;}
[解决办法]
LoveYoub LoveYou
[解决办法]
#include <windows.h>#include <string>#include <iostream>using namespace std;bool enough = false;int DarlingSayOK(const char * szmsg){ string strmsg; do { getline(cin, strmsg); } while (szmsg != strmsg); enough = true; return 0;}typedef DWORD (__stdcall * ThreadFunc)(void*);int main(){ CreateThread(NULL, 0, (ThreadFunc)(DarlingSayOK), (void *)"OK!", 0, NULL); for (int times = 0; times < 10000 && !enough; ++times) { cout << "I Love You!" << endl; Sleep(500); } return 0;}