#include <stdioh>
int main()
{
for (float y = 15f; y > -15f; y -= 01f)每次循环y的值减01;小于-15时停止循环;
{
for (float x = -15f; x < 15f; x += 005f)每次循环x的值加005,大于15时停止循环
{
float a = x x + y y - 1;
putchar(a a a - x x y y y <= 00f '' : ' ');aaa-xxyyy 的值小于等于00的时候输出否则输出空格;
}
putchar('\n');
}
}
最简单的就是你用printf来实现
或者你要用函数来画心就很麻烦了
比如#include<stdioh>
void main()
{
printf(" ");
printf(" ");
printf(" ");
printf(" ");
printf(" ");
printf(" ");
}
就这种样子,自己布局吧,如果想用画图函数,要么在tc环境下,要么在vc下获取控制台句柄,调用api,然后写一个画心形的函数
C语言版表白神器是一款非常有趣的电脑表白软件,本款C语言表白程序使用方法简单易懂,用户可通过它来轻松生成浪漫的红色爱心,从而让你的表白充满创新。C语言版表白神器可以帮你生成超级炫酷的表白爱心哦只需简单几步,就能将你想对他/她说的话用爱心表达出来转发到朋友圈,就是这么炫酷,开启炫酷装逼模式吧!
什么年代还写表白信哦晕倒!!!!
约她个好时间吧比如晚上
然后找个好地方比如广场或者少人些地方如果你是个比较开放的而不害羞的可以直接在多人的地方
看准时机当然 前提你们要聊些比较开心的事情 最好是小学时怎么样怎么样的
谈到开心时然后 望着她 (我不知道你那位女同学叫啥,就直接叫她的全名) XXX 我有话跟你说 其实我爱你
OK ! 这些不用教的吧 很容易 就怕你紧张呢
反正一句话概括
约个适合时分-选个适合环境-选个适合时机-做好前提-表白
很简单吧 呵呵 方法多姿多彩 看你是个怎样性格的人就用哪种方法适合你 70%成功率
希望对你有帮助
#define IdYes 1002
#define IdNo 1003
#define IdStatic 1004
#define IdTimer 1005
#define Width 640
#define Height 480
#define Tick 2000
#include<windowsh>
int x,y;
RECT rdesk;
HINSTANCE hinst;
HWND hyes,hno;
BOOL quit=FALSE;
LRESULT CALLBACK WndProc(HWND hwnd,UINT Message,WPARAM wParam,LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rclient;
HBRUSH hbrbkgnd;
static COLORREF c;
static BYTE r,g,b;
switch(Message)
{
case WM_TIMER:
if(IdTimer==LOWORD(wParam))
{
r=(BYTE)(rand()%256);
g=(BYTE)(rand()%256);
b=(BYTE)(rand()%256);
c=RGB(r,g,b);
InvalidateRect(hwnd,NULL,TRUE);
UpdateWindow(hwnd);
}
break;
case WM_PAINT:
hdc=BeginPaint(hwnd,&ps);
hbrbkgnd=CreateSolidBrush(c);
SelectObject(hdc,hbrbkgnd);
GetClientRect(hwnd,&rclient);
FillRect(hdc,&rclient,hbrbkgnd);
DeleteObject(hbrbkgnd);
EndPaint(hwnd,&ps);
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IdYes:
quit=TRUE;
MessageBox(hwnd,TEXT("回答正确,太太太好了!"),TEXT("宝贝"),MB_ICONEXCLAMATION|MB_OK);
SendMessage(hwnd,WM_CLOSE,0,0);
break;
case IdNo:
MessageBox(hwnd,TEXT("回答错误哦,我很生气呢!"),TEXT("宝贝"),MB_ICONEXCLAMATION|MB_OK);
break;
}
break;
case WM_SIZE:
case WM_MOVE:
SetWindowPos(hwnd,HWND_TOPMOST,x,y,Width,Height,SWP_SHOWWINDOW);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_CLOSE:
if(quit)
{
KillTimer(hwnd,IdTimer);
DestroyWindow(hwnd);
}
break;
case WM_CREATE:
CreateWindow(TEXT("Static"),
TEXT("请回答:做我女朋友好吗?"),
WS_CHILD|WS_VISIBLE|SS_CENTER,
200,
200,
240,
20,
hwnd,
(HMENU)IdStatic,
hinst,
NULL
);
hyes=CreateWindow(TEXT("Button"),
TEXT("好"),
WS_CHILD|WS_VISIBLE|BS_CENTER,
270,
230,
45,
20,
hwnd,
(HMENU)IdYes,
hinst,
NULL
);
hno=CreateWindow(TEXT("Button"),
TEXT("不好"),
WS_CHILD|WS_VISIBLE|BS_CENTER,
325,
230,
45,
20,
hwnd,
(HMENU)IdNo,
hinst,
NULL
);
SetTimer(hwnd,IdTimer,Tick,NULL);
break;
default:
return DefWindowProc(hwnd,Message,wParam,lParam);
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{
WNDCLASSEX wc;
HWND hwnd;
MSG msg;
hinst=hInstance;
srand(time(NULL));
memset(&wc,0,sizeof(wc));
wccbSize=sizeof(WNDCLASSEX);
wclpfnWndProc=WndProc;
wchInstance=hInstance;
wchCursor=LoadCursor(NULL,IDC_ARROW);
wchbrBackground=(HBRUSH)(COLOR_WINDOW+1);
wclpszClassName=TEXT("WindowClass");
wchIcon=LoadIcon(NULL,IDI_APPLICATION);
wchIconSm=LoadIcon(NULL,IDI_APPLICATION);
if(!RegisterClassEx(&wc))
{
MessageBox(NULL,TEXT("窗口注册失败!"),TEXT("错误"),MB_ICONEXCLAMATION|MB_OK);
return 0;
}
GetWindowRect(GetDesktopWindow(),&rdesk);
x=(rdeskright-Width)/2;
y=(rdeskbottom-Height)/2,
hwnd = CreateWindowEx(WS_EX_TOPMOST,
TEXT("WindowClass"),
TEXT("I Love You"),
WS_THICKFRAME|WS_VISIBLE,
x,
y,
Width,
Height,
NULL,NULL,hInstance,NULL);
if(NULL==hwnd)
{
MessageBox(NULL,TEXT("窗口创建失败!"),TEXT("错误!"),MB_ICONEXCLAMATION|MB_OK);
return 0;
}
while(GetMessage(&msg,NULL,0,0)>0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msgwParam;
}
截图
欢迎分享,转载请注明来源:表白网
评论列表(0条)