写在情人节的小程序

来源:互联网 发布:python array转置 编辑:程序博客网 时间:2024/04/27 17:49

 "对你爱 爱 爱不完"!

#include <iostream>using namespace std;int main(){    for (unsigned char times = 0; times <= 255; ++times)    {        cout << "我爱你!" << endl;    }    return 0;}


"说一万遍我爱你 直到你满意"!

#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;}

原创粉丝点击