求一个用于表白的C语言或C++的程序,谢谢大家了

求一个用于表白的C语言或C++的程序,谢谢大家了,第1张

#include <stdioh>

#include <mathh>

#include <stdlibh>

#define I 20

#define R 340

#include <stringh>

int main()

{

char answer[10];

printf("遇到你\n我才发现\n曾经所有的条件\n似乎都成了我等你的借口\n\n");

printf("我对你的感情已经决堤\n所以\n请允许我,从今往后映入你\n明媚的眼\n");

printf("我\n想和你\n耳鬓厮磨,相濡以沫!");

printf("答应我吧!\n输入yes,你可以看到我的真心\n");

scanf("%s", answer);

float y, x, z, f;

for (y = 15f; y > -15f; y -= 01f)

{

for (x = -15f; x < 15f; x += 005f)

{

z = x x + y y - 1;

f = z zz - x xyyy;

putchar(f <= 00f ""[(int)(f-80f)] : ' ');

}

putchar('\n');

}

long time;

for (;;)

{

system("color a");

for (time = 0; time<99999999; time++);

system("color b");

for (time = 0; time<99999999; time++);

system("color c");

for (time = 0; time<99999999; time++);

system("color d");

for (time = 0; time<99999999; time++);

system("color e");

for (time = 0; time<99999999; time++);

system("color f");

for (time = 0; time<99999999; time++);

system("color 0");

for (time = 0; time<99999999; time++);

system("color 1");

for (time = 0; time<99999999; time++);

system("color 2");

for (time = 0; time<99999999; time++);

system("color 3");

for (time = 0; time<99999999; time++);

system("color 4");

for (time = 0; time<99999999; time++);

system("color 5");

for (time = 0; time<99999999; time++);

system("color 6");

for (time = 0; time<99999999; time++);

system("color 7");

for (time = 0; time<99999999; time++);

system("color 8");

for (time = 0; time<99999999; time++);

system("color 9");

}

getchar();

return 0;

}

运行效果:

扩展资料:

printf函数使用注意事项

1、域宽

%d:按整型数据的实际长度输出

如果想输出指定宽度可以指定域宽,%md--&gt;m域宽,打印出来以后,在控制台上,显示m位;

如果我们要打印的数的位数如果超过我们设定m则原样输出;

如果我们要打印的数的位数如果小于我们设定的位数,则补空白,具体如下:

如果m为正数,则左对齐(左侧补空白);

如果m为负数,则右对齐(右侧补空白)。

2、转义字符

如果想输出字符"%",则应该在“格式控制”字符串中用连续两个%表示。

如:printf("%f%%",1.0/3);输出结果:0.333333%。

Private Sub Command1_Click()

MeCls

Dim s As Single, j As Long, t As String, n As Long, m As Long

For j = 1000 To 9999

t = j

m = 0

For k = 1 To 4

n = Val(Mid(t, k, 1))

m = m + n n n n

Next

If m = j Then

Print j; "为玫瑰花数"

s = s + j

End If

Next

Print "总和为:"; s

End Sub

你的描述我不是很明白,可以给你个思路!首先找个爱心形状的,加载进窗体的picturebox中,调整到合适大小。然后用以下让窗体透明。'设置MeBorderStyle = 0

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Private Const WS_EX_LAYERED = &H80000

Private Const GWL_EXSTYLE = (-20)

Private Const LWA_ALPHA = &H2

Private Const LWA_COLORKEY = &H1

Private Declare Function ReleaseCapture Lib "user32" () As Long

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Const WM_NCLBUTTONDOWN = &HA1

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Private Sub Form_Load()

MeBackColor = &HFF0000

Dim rtn As Long

rtn = GetWindowLong(hwnd, GWL_EXSTYLE)

rtn = rtn Or WS_EX_LAYERED

SetWindowLong hwnd, GWL_EXSTYLE, rtn

SetLayeredWindowAttributes hwnd, &HFF0000, 0, LWA_COLORKEY

End Sub

欢迎分享,转载请注明来源:表白网

原文地址:https://h5.hunlipic.com/biaobai/3860097.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2024-03-30
下一篇2024-03-30

发表评论

登录后才能评论

评论列表(0条)

    保存