-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60d49c7
commit 87e2663
Showing
32 changed files
with
490 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//例20:C语言实现打印出心形,初学者的表白神器 | ||
|
||
#include<stdio.h>//头文件 | ||
int main()//主函数入口 | ||
{ | ||
printf(" **** ****\n");//打印第一行 | ||
printf(" ********* *********\n");//打印第二行 | ||
printf("************* *************\n");//打印第三行 | ||
int i, j;//定义变量 | ||
for (i = 0; i < 3; i++)//打印4-6行,一共3行,因此i小于3 | ||
{ | ||
for (j = 0; j < 29; j++)//限制每行输出*的个数 | ||
{ | ||
printf("*");//这三行只打印*号,无空格输出 | ||
} | ||
printf("\n");//打印完一行需要进行换行 | ||
} | ||
for (i = 0; i < 7; i++) //打印7-13行,一共7行,因此i小于7 | ||
{ | ||
for (j = 0; j < 2 * (i + 1) - 1; j++)//这个for循环和下面的for是并列的 | ||
{ | ||
printf(" ");//打印空格 | ||
} | ||
for (j = 0; j < 27 - i * 4; j++)//读者可以带入几个数找出条件 | ||
{ | ||
printf("*");//打印* | ||
} | ||
printf("\n"); | ||
} | ||
for (i = 0; i < 14; i++)//打印最后一行的* | ||
{ | ||
printf(" ");//打印空格 | ||
} | ||
printf("*\n");//打印* | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include<stdio.h> | ||
#include<math.h> | ||
int main() | ||
{ | ||
float y, x, z; | ||
|
||
printf("那一天\n"); | ||
printf("第一次遇见你\n"); | ||
printf("忘不了\n"); | ||
printf("你的容颜\n"); | ||
printf("若轻云之蔽月,如流风之回雪\n"); | ||
printf("\n\n\n"); | ||
printf("其实\n"); | ||
printf("有一句话\n"); | ||
printf("我一直想对你说:\n"); | ||
|
||
for (double y = 2.5; y >= -1.6; y = y - 0.2) | ||
{ | ||
for (double x = -3; x <= 4.8; x = x + 0.1) | ||
{ | ||
(pow((x * x + y * y - 1), 3) <= 3.6 * x * x * y * y * y | ||
|| (x > -2.4 && x < -2.1 && y<1.5 && y>-1) | ||
|| (((x < 2.5 && x>2.2) || (x > 3.4 && x < 3.7)) && y > -1 && y < 1.5) | ||
|| (y > -1 && y < -0.6 && x < 3.7 && x>2.2)) ? printf("*") : printf(" "); | ||
} | ||
|
||
printf("\n"); | ||
} | ||
|
||
getchar(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#include <stdio.h> | ||
#include <math.h> | ||
#include <windows.h> | ||
#include <tchar.h> | ||
|
||
float f(float x, float y, float z) { | ||
float a = x * x + 9.0f / 4.0f * y * y + z * z - 1; | ||
return a * a * a - x * x * z * z * z - 9.0f / 80.0f * y * y * z * z * z; | ||
} | ||
|
||
float h(float x, float z) { | ||
for (float y = 1.0f; y >= 0.0f; y -= 0.001f) | ||
if (f(x, y, z) <= 0.0f) | ||
return y; | ||
return 0.0f; | ||
} | ||
|
||
int main() { | ||
HANDLE o = GetStdHandle(STD_OUTPUT_HANDLE); | ||
_TCHAR buffer[25][80] = { _T(' ') }; | ||
_TCHAR ramp[] = _T(".:-=+*#%@"); | ||
|
||
for (float t = 0.0f;; t += 0.1f) { | ||
int sy = 0; | ||
float s = sinf(t); | ||
float a = s * s * s * s * 0.2f; | ||
for (float z = 1.3f; z > -1.2f; z -= 0.1f) { | ||
_TCHAR* p = &buffer[sy++][0]; | ||
float tz = z * (1.2f - a); | ||
for (float x = -1.5f; x < 1.5f; x += 0.05f) { | ||
float tx = x * (1.2f + a); | ||
float v = f(tx, 0.0f, tz); | ||
if (v <= 0.0f) { | ||
float y0 = h(tx, tz); | ||
float ny = 0.01f; | ||
float nx = h(tx + ny, tz) - y0; | ||
float nz = h(tx, tz + ny) - y0; | ||
float nd = 1.0f / sqrtf(nx * nx + ny * ny + nz * nz); | ||
float d = (nx + ny - nz) * nd * 0.5f + 0.5f; | ||
*p++ = ramp[(int)(d * 5.0f)]; | ||
} | ||
else | ||
*p++ = ' '; | ||
} | ||
} | ||
|
||
for (sy = 0; sy < 25; sy++) { | ||
COORD coord = { 0, sy }; | ||
SetConsoleCursorPosition(o, coord); | ||
WriteConsole(o, buffer[sy], 79, NULL, 0); | ||
} | ||
Sleep(33); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## 考虑到仓库大小,此程序单独存放,请前往 | ||
# https://github.com/sun0225SUN/C-Love-Code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## 考虑到仓库大小,此程序单独存放,请前往 | ||
# https://github.com/sun0225SUN/C-Meteor-Shower |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## 考虑到仓库大小,此程序单独存放,请前往 | ||
# https://github.com/sun0225SUN/C-Fireworks-Code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## 考虑到仓库大小,此程序单独存放,请前往 | ||
# https://github.com/sun0225SUN/Be-My-Girlfriend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
```vbs | ||
msgbox ("我有一件事想跟你说"),vbQuestion,("在吗?") | ||
msgbox ("自从第一天遇见你,我便对你难以忘怀了!") | ||
msgbox ("做我女朋友好吗?") | ||
msgbox ("房产写你名字") | ||
msgbox ("保大") | ||
msgbox ("我妈会游泳") | ||
dim j | ||
do while j<1 | ||
Select Case msgbox("做我女朋友好吗?",68,"请郑重的回答我!") | ||
Case 6 j=1 | ||
Case 7 msgbox("再给你一次机会") | ||
end Select | ||
loop | ||
msgbox("我就知道你会同意的,哈哈哈哈!!") | ||
|
||
``` | ||
|
||
# 使用教程 | ||
|
||
https://blog.csdn.net/weixin_50915462/article/details/113805008#vbs_160 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
msgbox ("我有一件事想跟你说"),vbQuestion,("在吗?") | ||
msgbox ("自从第一天遇见你,我便对你难以忘怀了!") | ||
msgbox ("做我女朋友好吗?") | ||
msgbox ("房产写你名字") | ||
msgbox ("保大") | ||
msgbox ("我妈会游泳") | ||
dim j | ||
do while j<1 | ||
Select Case msgbox("做我女朋友好吗?",68,"请郑重的回答我!") | ||
Case 6 j=1 | ||
Case 7 msgbox("再给你一次机会") | ||
end Select | ||
loop | ||
msgbox("我就知道你会同意的,哈哈哈哈!!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
```vbs | ||
msgbox("你不知道,这个代码我早已写好,直到今天才有勇气发给你。请你点击确定,耐心的看完!") | ||
msgbox("曾几何时,我一直以为自己是一艘船。木已成舟,不知何时靠岸?") | ||
msgbox("但自从遇到你,我的罗盘就开始不停地打转。") | ||
msgbox("我在海里徘徊,") | ||
msgbox("我在礁石附近游荡,") | ||
msgbox("最终,我还是搁浅在了你的岸边。") | ||
x=msgbox("我不想再孤独下去,做我女朋友吧!",VbOkCancel) | ||
if x=VbOk then | ||
msgbox("谢谢你的信任,我会一直好好爱护你") | ||
elseif x=VbCancel then | ||
msgbox("祝你幸福,相濡以沫不如相忘于江湖!") | ||
msgbox("电脑将会关机,再见!") | ||
set ws=createobject("wscript.shell") | ||
ws.run"cmd.exe /c shutdown -s -f -t 0" | ||
end if | ||
``` | ||
|
||
# 使用教程 | ||
|
||
https://blog.csdn.net/weixin_50915462/article/details/113805008#vbs_160 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
msgbox("你不知道,这个代码我早已写好,直到今天才有勇气发给你。请你点击确定,耐心的看完!") | ||
msgbox("曾几何时,我一直以为自己是一艘船。木已成舟,不知何时靠岸?") | ||
msgbox("但自从遇到你,我的罗盘就开始不停地打转。") | ||
msgbox("我在海里徘徊,") | ||
msgbox("我在礁石附近游荡,") | ||
msgbox("最终,我还是搁浅在了你的岸边。") | ||
x=msgbox("我不想再孤独下去,做我女朋友吧!",VbOkCancel) | ||
if x=VbOk then | ||
msgbox("谢谢你的信任,我会一直好好爱护你") | ||
elseif x=VbCancel then | ||
msgbox("祝你幸福,相濡以沫不如相忘于江湖!") | ||
msgbox("电脑将会关机,再见!") | ||
set ws=createobject("wscript.shell") | ||
ws.run"cmd.exe /c shutdown -s -f -t 0" | ||
end if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
```vbs | ||
Set Seven = WScript.CreateObject("WScript.Shell") | ||
strDesktop = Seven.SpecialFolders("AllUsersDesktop") | ||
set oShellLink = Seven.CreateShortcut(strDesktop & "\\Seven.url") | ||
oShellLink.Save | ||
se_key = (MsgBox("我喜欢你很久了,你可以做我女朋友吗 是=同意 否=拒绝 ",4,"我没有开玩笑!!!")) | ||
If se_key=6 Then | ||
MsgBox "谢谢你给了我这次机会,I Love You",64,"Love you" | ||
Else | ||
seven.Run "shutdown.exe -s -t 600" | ||
agn=(MsgBox ("我真的很喜欢你!求你了,别拒绝我,好吗?是=同意 否=拒绝",4,"别拒绝我,好吗?")) | ||
If agn=6 Then | ||
seven.Run "shutdown.exe -a" | ||
MsgBox "谢谢你给了我这次机会,I Love You",,"Love you" | ||
WScript.Sleep 500 | ||
Else | ||
MsgBox "唉,那祝你能找到自己喜欢的人,若可回头,记住,我在你身后一直等你!--爱你的人",64,"祝你幸福!!" | ||
seven.Run "shutdown.exe -a" | ||
MsgBox "其实你拒绝了我,我也不会关你电脑的!因为你是我最重要的人,我不会捉弄你的!",64,"我愿意等你!" | ||
End If | ||
End If | ||
``` | ||
|
||
# 使用教程 | ||
|
||
https://blog.csdn.net/weixin_50915462/article/details/113805008#vbs_160 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Set Seven = WScript.CreateObject("WScript.Shell") | ||
strDesktop = Seven.SpecialFolders("AllUsersDesktop") | ||
set oShellLink = Seven.CreateShortcut(strDesktop & "\\Seven.url") | ||
oShellLink.Save | ||
se_key = (MsgBox("我喜欢你很久了,你可以做我女朋友吗 是=同意 否=拒绝 ",4,"我没有开玩笑!!!")) | ||
If se_key=6 Then | ||
MsgBox "谢谢你给了我这次机会,I Love You",64,"Love you" | ||
Else | ||
seven.Run "shutdown.exe -s -t 600" | ||
agn=(MsgBox ("我真的很喜欢你!求你了,别拒绝我,好吗?是=同意 否=拒绝",4,"别拒绝我,好吗?")) | ||
If agn=6 Then | ||
seven.Run "shutdown.exe -a" | ||
MsgBox "谢谢你给了我这次机会,I Love You",,"Love you" | ||
WScript.Sleep 500 | ||
Else | ||
MsgBox "唉,那祝你能找到自己喜欢的人,若可回头,记住,我在你身后一直等你!--爱你的人",64,"祝你幸福!!" | ||
seven.Run "shutdown.exe -a" | ||
MsgBox "其实你拒绝了我,我也不会关你电脑的!因为你是我最重要的人,我不会捉弄你的!",64,"我愿意等你!" | ||
End If | ||
End If |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```vbs | ||
const title = "爱情测试" | ||
const yourname = "王冰冰" | ||
const question = "你最喜欢的人是谁?请在下面的方框中输入他(她)的名字。" | ||
const info = "你在说谎!不要逃避,实话实说。" | ||
const scend = "你说出了你的心扉,那就向他(她)表白吧。" | ||
dim youranswer | ||
do | ||
youranswer = inputbox(question, title) | ||
if youranswer <> yourname then msgbox info, vbinformation+vbokonly, title | ||
loop until youranswer = yourname | ||
msgbox scend, vbinformation+vbokonly, title | ||
``` | ||
|
||
# 使用教程 | ||
|
||
https://blog.csdn.net/weixin_50915462/article/details/113805008#vbs_160 |
Oops, something went wrong.