了解更多关注软协官网:https://www.csuftsap.cn/
来自软件协会编辑,注册会员即可获取全部开源.md资源,请勿转载,归软件协会所有。
文章目录
- :star: 软件协会第01次活动第05次任务布置
- 1.程序员的浪漫-爱心代码(升级版)
- 1.1 官网下载EasyX
- 1.2 安装EasyX
- 1.3 重启vs,新建项目并在其中创建一个.cpp文件(如果之前打开了vs,请重启vs)
- 1.4 将如下代码拷贝到 love.cpp 文件中运行即可
- 1.5 :round_pushpin: 运行该 .cpp 文件
- 2.演奏歌曲(选做)
- 2.1 平凡之路
- 2.2 海阔天空
- 2.3 起风了
- 2.4 光阴的故事
- 2.5 第一次爱的人
- 3.typora的导出
- 3.1 导出为pdf
- 3.2 导出为word文档
- 3.2.1 下载与安装pandoc
- 3.2.2 typora配置pandoc
- 3.2.3 导出为word
- 3.3 :round_pushpin: 作业展示
- 4.github注册登录与typora主题获取
- 4.0 说明
- 4.0.1 GitHub简介
- 4.0.2 Github能给你带来什么
- 4.1 github网址填写邮箱
- 4.2 设置密码(包含字母大小写和数字)
- 4.3 设置英文用户名
- 4.4 选择是否接受消息推送
- 4.5 真人验证
- 4.6 邮箱验证
- 4.7 信息填写
- 4.8 注册成功
- 4.9 获取typora主题
- 4.10 :round_pushpin: 作业展示
- 5.函数练习
- 5.1 :round_pushpin: 求和
- 5.2 :round_pushpin: 回文数
- 5.3 :round_pushpin: 函数表达式的值
- 6.写一篇自己的csdn文章
- 6.1 选题范围
- 6.2 编写步骤
- 6.3 :round_pushpin: 分享
- 7.总结
- 7.1 个人学习总结
- 7.2 对软件协会的评价与建议
⭐️ 软件协会第01次活动第05次任务布置
📍 来自:中南林业科技大学软件协会学术部:谢添
⏲ 时间:2022 - 11 - 27
🏠 官网:https://www.csuftsap.cn/
💬 任务布置说明:
- 题目考察范围:函数
- 所有答案均放在我所写的
空代码块
或空引用框
中
🚀 本学期我们的练习到这里就结束了,如果我们的缘分未尽,寒假再见💓
1.程序员的浪漫-爱心代码(升级版)
1.1 官网下载EasyX
EasyX 是针对 C/C++ 的图形库,可以帮助使用C/C++语言的程序员快速上手图形和游戏编程。
比如,可以用 VC + EasyX 很快的用几何图形画一个房子,或者一辆移动的小车,可以编写俄罗斯方块、贪吃蛇、黑白棋等小游戏,可以练习图形学的各种算法,等等。
这里只是本次任务的小热身。
🏠 https://easyx.cn/download
1.2 安装EasyX
1.3 重启vs,新建项目并在其中创建一个.cpp文件(如果之前打开了vs,请重启vs)
也可以在vs界面内使用 ctrl + shift + A 快速创建文件
1.4 将如下代码拷贝到 love.cpp 文件中运行即可
#include<graphics.h>
#include<conio.h>
#include<time.h>
#include<math.h>
#include<stdlib.h>
/*
作者:那蔚蓝天空
*/
struct Point {
double x, y;
COLORREF color;
};
COLORREF colors[256] = { RGB(255,32,83),RGB(252,222,250) ,RGB(255,0,0) ,
RGB(255,0,0) ,RGB(255,2,2) ,RGB(255,0,8) ,RGB(255,5,5) };
const int xScreen = 1200;
const int yScreen = 800;
const double PI = 3.1426535159;
const double e = 2.71828;
const double averag_distance = 0.162;
const int quantity = 506;
const int circles = 210;
const int frames = 20;
Point origin_points[quantity];
Point points[circles * quantity];
IMAGE images[frames];
double screen_x(double x)
{
x += xScreen / 2;
return x;
}
double screen_y(double y)
{
y = -y + yScreen / 2;
return y;
}
int creat_random(int x1, int x2)
{
if (x2 > x1)
return rand() % (x2 - x1 + 1) + x1;
}
void creat_data()
{
int index = 0;
double x1 = 0, y1 = 0, x2 = 0, y2 = 0;
for (double radian = 0.1; radian <= 2 * PI; radian += 0.005)
{
x2 = 16 * pow(sin(radian), 3);
y2 = 13 * cos(radian) - 5 * cos(2 * radian) - 2 * cos(3 * radian)
- cos(4 * radian);
double distance = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
if (distance > averag_distance)
{
x1 = x2, y1 = y2;
origin_points[index].x = x2;
origin_points[index++].y = y2;
}
}
index = 0;
for (double size = 0.1, lightness = 1.5; size <= 20; size += 0.1)
{
double success_p = 1 / (1 + pow(e, 8 - size / 2));
if (lightness > 1) lightness -= 0.0025;
for (int i = 0; i < quantity; ++i)
{
if (success_p > creat_random(0, 100) / 100.0)
{
COLORREF color = colors[creat_random(0, 6)];
points[index].color = RGB(GetRValue(color) / lightness, GetGValue(color) / lightness, GetBValue(color) / lightness);
points[index].x = size * origin_points[i].x + creat_random(-4, 4);
points[index++].y = size * origin_points[i].y + creat_random(-4, 4);
}
}
}
int points_size = index;
for (int frame = 0; frame < frames; ++frame)
{
images[frame] = IMAGE(xScreen, yScreen);
SetWorkingImage(&images[frame]);
for (index = 0; index < points_size; ++index)
{
double x = points[index].x, y = points[index].y;
double distance = sqrt(pow(x, 2) + pow(y, 2));
double diatance_increase = -0.0009 * distance * distance
+ 0.35714 * distance + 5;
double x_increase = diatance_increase * x / distance / frames;
double y_increase = diatance_increase * y / distance / frames;
points[index].x += x_increase;
points[index].y += y_increase;
setfillcolor(points[index].color);
solidcircle(screen_x(points[index].x), screen_y(points[index].y), 1);
}
for (double size = 17; size < 23; size += 0.3)
{
for (index = 0; index < quantity; ++index)
{
if ((creat_random(0, 100) / 100.0 > 0.6 && size >= 20)
|| (size < 20 && creat_random(0, 100) / 100.0 > 0.95))
{
double x, y;
if (size >= 20)
{
x = origin_points[index].x * size +
creat_random(-frame * frame / 5 - 15, frame * frame / 5 + 15);
y = origin_points[index].y * size +
creat_random(-frame * frame / 5 - 15, frame * frame / 5 + 15);
}
else
{
x = origin_points[index].x * size + creat_random(-5, 5);
y = origin_points[index].y * size + creat_random(-5, 5);
}
setfillcolor(colors[creat_random(0, 6)]);
solidcircle(screen_x(x), screen_y(y), 1);
}
}
}
}
SetWorkingImage();
}
int main()
{
initgraph(xScreen, yScreen);
BeginBatchDraw();
srand(time(0));
creat_data();
bool extend = true, shrink = false;
for (int frame = 0; !_kbhit();)
{
putimage(0, 0, &images[frame]);
FlushBatchDraw();
Sleep(20);
cleardevice();
if (extend)
frame == 19 ? (shrink = true, extend = false) : ++frame;
else
frame == 0 ? (shrink = false, extend = true) : --frame;
}
EndBatchDraw();
closegraph();
return 0;
}
1.5 📍 运行该 .cpp 文件
将你运行出来的结果截图放入下面的引用框中:
2.演奏歌曲(选做)
💬 只需要将刚才写的 love.cpp 文件里的全部代码替换为下面的代码即可,你也可以选择新开文件,但一定是以 .cpp
结尾的文件。以下代码不需要用到 EasyX
插件。如果你对演奏音乐感兴趣,那么当你学到 C++ 的时候就可以去学习用代码演奏自己喜欢的音乐,这不会太难,只要找到你选择的歌曲的谱子按照对应关系填写对应代码即可。一定要谱一曲《告白气球》,去和你爱的男孩或女孩表白❤️
2.1 平凡之路
#include <iostream>
#include <Windows.h>
#pragma comment(lib,"winmm.lib")
using namespace std;
/*
作者:子任-逸仙
*/
enum Scale
{
Rest = 0, C8 = 108, B7 = 107, A7s = 106, A7 = 105, G7s = 104, G7 = 103, F7s = 102, F7 = 101, E7 = 100,
D7s = 99, D7 = 98, C7s = 97, C7 = 96, B6 = 95, A6s = 94, A6 = 93, G6s = 92, G6 = 91, F6s = 90, F6 = 89,
E6 = 88, D6s = 87, D6 = 86, C6s = 85, C6 = 84, B5 = 83, A5s = 82, A5 = 81, G5s = 80, G5 = 79, F5s = 78,
F5 = 77, E5 = 76, D5s = 75, D5 = 74, C5s = 73, C5 = 72, B4 = 71, A4s = 70, A4 = 69, G4s = 68, G4 = 67,
F4s = 66, F4 = 65, E4 = 64, D4s = 63, D4 = 62, C4s = 61, C4 = 60, B3 = 59, A3s = 58, A3 = 57, G3s = 56,
G3 = 55, F3s = 54, F3 = 53, E3 = 52, D3s = 51, D3 = 50, C3s = 49, C3 = 48, B2 = 47, A2s = 46, A2 = 45,
G2s = 44, G2 = 43, F2s = 42, F2 = 41, E2 = 40, D2s = 39, D2 = 38, C2s = 37, C2 = 36, B1 = 35, A1s = 34,
A1 = 33, G1s = 32, G1 = 31, F1s = 30, F1 = 29, E1 = 28, D1s = 27, D1 = 26, C1s = 25, C1 = 24, B0 = 23,
A0s = 22, A0 = 21
};
enum Voice
{
X1 = C2, X2 = D2, X3 = E2, X4 = F2, X5 = G2, X6 = A2, X7 = B2,
L1 = C3, L2 = D3, L3 = E3, L4 = F3, L5 = G3, L6 = A3, L7 = B3,
M1 = C4, M2 = D4, M3 = E4, M4 = F4, M5 = G4, M6 = A4, M7 = B4,
H1 = C5, H2 = D5, H3 = E5, H4 = F5, H5 = G5, H6 = A5, H7 = B5,
LOW_SPEED = 500, MIDDLE_SPEED = 400, HIGH_SPEED = 300,
_ = 0XFF
};
void Trivial()
{
HMIDIOUT handle;
midiOutOpen(&handle, 0, 0, 0, CALLBACK_NULL);
int volume = 0x7f;
int voice = 0x0;
int sleep = 300;
int trivial[] =
{
MIDDLE_SPEED, X6,L6,M3,M1,M1,L4,M4,M1,X1,L5,M3,M1,L7,M1,M2,L5,X6,L6,M3,M1,M1,L4,M4,M1,X1,L5,M3,M1,L7,M1,M2,L5,_,_,
400,M3,M3,0,M6,M6,_,_,400,M1,M2,0,M3,M3,_,400,_,_,_,_,_,_,_,_,M3,M3,0,M6,M6,_,_,400,_,M5,M5,M4,M3,_,_,_,_,_,_,_,_,
M3,M3,M6,_,M1,M2,M3,_,_,_,_,_,_,_,M3,M3,M1,M4,0,M4,M4,_,400,M3,M1,_,_,_,
400,M3,M3,0,M6,M6,_,_,400,M1,M2,0,M3,M3,_,400,_,_,_,_,_,_,_,_,M3,M3,0,M6,M6,_,_,400,_,M5,M5,M4,M3,_,_,_,_,_,_,_,_,
M3,M3,M6,_,M1,M2,M3,_,_,_,_,_,_,_,M3,M3,M1,M4,0,M4,M4,_,400,M3,M1,_,_,_,_,_,
M5,M6,M7,H1,0,M7,H1,_,M5,300,M6,M6,_,M5,0,M4,M3,_,300,M3,M3,0,M3,M2,_,300,M5,M6,M7,H1,0,M7,H1,_,M5,300,M6,M6,_,M6,0,H1,H1,_,300,H1,H1,0,H1,H2,_,M5,300,
M6,M7,H1,0,M7,H1,_,H3,700,H6,700,H5,_,H4,H3,_,H3,H2,_,
M6,700,M7,H1,_,700,H1,0,H2,H1,_,H1,M7,300,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,_,400,_,_,_,_,_,_,_,_,M3,M3,0,M6,M6,_,_,400,_,M5,M5,M4,M3,_,_,_,_,_,_,_,_,
M3,M3,M6,_,M1,M2,M3,_,_,_,_,_,_,_,M3,M3,M1,0,M4,300,M4,M4,_,400,M3,M1,_,_,_,_,_,
};
for (auto i : trivial) {
if (i == LOW_SPEED || i == HIGH_SPEED || i == MIDDLE_SPEED) {
sleep = i;//Sleep(i/2);
continue;
}
if (i == 0) { sleep = 150; continue; }
if (i == 700) { Sleep(180); continue; }
if (i == _) {
Sleep(300);
continue;
}
voice = (volume << 16) + (i << 8) + 0x90;
midiOutShortMsg(handle, voice);
cout << voice << endl;
Sleep(sleep);
}
midiOutClose(handle);
}
int main()
{
Trivial();
return 0;
}
2.2 海阔天空
#include <iostream>
#include <Windows.h>
#pragma comment(lib,"winmm.lib")
using namespace std;
/*
作者:子任-逸仙
*/
enum Scale
{
Rest = 0, C8 = 108, B7 = 107, A7s = 106, A7 = 105, G7s = 104, G7 = 103, F7s = 102, F7 = 101, E7 = 100,
D7s = 99, D7 = 98, C7s = 97, C7 = 96, B6 = 95, A6s = 94, A6 = 93, G6s = 92, G6 = 91, F6s = 90, F6 = 89,
E6 = 88, D6s = 87, D6 = 86, C6s = 85, C6 = 84, B5 = 83, A5s = 82, A5 = 81, G5s = 80, G5 = 79, F5s = 78,
F5 = 77, E5 = 76, D5s = 75, D5 = 74, C5s = 73, C5 = 72, B4 = 71, A4s = 70, A4 = 69, G4s = 68, G4 = 67,
F4s = 66, F4 = 65, E4 = 64, D4s = 63, D4 = 62, C4s = 61, C4 = 60, B3 = 59, A3s = 58, A3 = 57, G3s = 56,
G3 = 55, F3s = 54, F3 = 53, E3 = 52, D3s = 51, D3 = 50, C3s = 49, C3 = 48, B2 = 47, A2s = 46, A2 = 45,
G2s = 44, G2 = 43, F2s = 42, F2 = 41, E2 = 40, D2s = 39, D2 = 38, C2s = 37, C2 = 36, B1 = 35, A1s = 34,
A1 = 33, G1s = 32, G1 = 31, F1s = 30, F1 = 29, E1 = 28, D1s = 27, D1 = 26, C1s = 25, C1 = 24, B0 = 23,
A0s = 22, A0 = 21
};
enum Voice
{
X1 = C2, X2 = D2, X3 = E2, X4 = F2, X5 = G2, X6 = A2, X7 = B2,
L1 = C3, L2 = D3, L3 = E3, L4 = F3, L5 = G3, L6 = A3, L7 = B3,
M1 = C4, M2 = D4, M3 = E4, M4 = F4, M5 = G4, M6 = A4, M7 = B4,
H1 = C5, H2 = D5, H3 = E5, H4 = F5, H5 = G5, H6 = A5, H7 = B5,
LOW_SPEED = 500, MIDDLE_SPEED = 400, HIGH_SPEED = 300,
_ = 0XFF
};
void HKTK()
{
HMIDIOUT handle;
midiOutOpen(&handle, 0, 0, 0, CALLBACK_NULL);
//midiOutShortMsg(handle, 34 << 8 | 0xC0);
int volume = 0x7f;
int voice = 0x0;
int sleep = 400; int tmp = 0;
int hktk[] =
{
X4,(H7 - 1),_,H6,_,_,_, H5,H4,H3,H2,_,(L7 - 1),M1,M4,(X7 - 1),_,_,_,_, (L7 - 1),M1,M4,(X7 - 1),_,_,_,_,(L7 - 1),M1,M5,M4,_,_,_,_,_,M4,_,M3,_,_,_,
1000,M3,0,M2,700,300,M1,_,_,_,_,_,_,0,M3,M4,300,M5,0,M5,M5,300,_,M6,700,M5,_,_,
0,M6,M7,300,H1,0,H1,300,H1,700,H1,H1,M7,0,M6,300,M5,700,0,M6,300,_,_,_,_,_,
M6,M5,M5,_,_,M5,M3,_,M3,M4,M3,M2,M2,0,M3,M2,300,_,_,M3,0,M2,M2,_,300,M1,M1,0,M1,M1,300,_,_,M2,M1,M1,_,_,_,_,_,_,
1000,M3,0,M2,700,300,M1,_,_,_,_,_,_,0,M3,M4,300,M5,0,M5,M5,300,_,M6,700,M5,_,_,
0,M6,M7,300,H1,0,H1,300,H1,700,H1,H1,M7,0,M6,300,M5,700,0,M6,300,_,_,_,_,_,
M6,M5,M5,_,_,M5,M3,_,M3,M4,M3,M2,M2,0,M3,M2,300,_,_,M3,0,M2,M2,_,300,M1,M1,0,M1,M1,300,_,_,M2,M1,M1,_,_,_,_,_,_,
_,0,M6,M7,300,H1,0,H1,H1,_,300,H1,M7,M6,0,M5,300,M5,700,M5,_,0,M3,300,M2,700,M1,_,_,_,_,0,H1,H1,300,H1,0,H1,H2,_,300,H2,0,H1,300,H2,700,H3,_,_,_,H3,0,H2,300,H1,700,
_,0,H1,H1,300,H1,0,H1,H2,300,_,_,_,0,M5,M5,300,H3,_,H2,_,H1,_,_,_,
_,0,H1,H1,300,H1,0,H1,H2,300,_,0,H2,H2,H1,300,M7,700,H1,_,_,_,_,_,_,_,
1000,M3,0,M2,700,300,M1,_,_,_,_,_,_,0,M3,M4,300,M5,0,M5,M5,300,_,M6,700,M5,_,_,
0,M6,M7,300,H1,0,H1,300,H1,700,H1,H1,M7,0,M6,300,M5,700,0,M6,300,_,_,_,_,_,
M6,M5,M5,_,_,M5,M3,_,M3,M4,M3,M2,M2,0,M3,M2,300,_,_,M3,0,M2,M2,_,300,M1,M1,0,M1,M1,300,_,_,M2,M1,M1,_,_,_,_,_,_,
_,0,M6,M7,300,H1,0,H1,H1,_,300,H1,M7,M6,0,M5,300,M5,700,M5,_,0,M3,300,M2,700,M1,_,_,_,_,0,H1,H1,300,H1,0,H1,H2,_,300,H2,0,H1,300,H2,700,H3,_,_,_,H3,0,H2,300,H1,700,
_,0,H1,H1,300,H1,0,H1,H2,300,_,_,_,0,M5,M5,300,H3,_,H2,_,H1,_,_,_,
_,0,H1,H1,300,H1,0,H1,H2,300,_,0,H2,H2,H1,300,M7,700,H1,_,_,_,_,_,_,_,
M6,M6,M7,M6,M7,H1,_,_,_,0,H1,H1,300,H2,H1,H2,H3,_,_,_,H3,H2,_,_,0,H2,H3,300,H1,_,_,_,_,_,
_,0,M6,M7,300,H1,0,H1,H1,_,300,H1,M7,M6,0,M5,300,M5,700,M5,_,0,M3,300,M2,700,M1,_,_,_,_,0,H1,H1,300,H1,0,H1,H2,_,300,H2,0,H1,300,H2,700,H3,_,_,_,H3,0,H2,300,H1,700,
_,0,H1,H1,300,H1,0,H1,H2,300,_,_,_,0,M5,M5,300,H3,_,H2,_,H1,_,_,_,
_,0,H1,H1,300,H1,0,H1,H2,300,_,0,H2,H2,H1,300,M7,700,H1,_,_,_,_,_,_,_,
_,0,H1,H1,300,H1,0,H1,H2,300,_,_,_,0,M5,M5,300,H3,_,H2,_,H1,_,_,_,
_,0,H1,H1,300,H1,0,H1,H2,300,_,0,H2,H2,H1,300,M7,700,H1,_,_,_,_,_,_,_,
_,0,M6,M7,300,H1,0,H1,H1,_,300,H1,M7,M6,0,M5,300,M5,700,M5,_,0,M3,300,M2,700,M1,_,_,_,_,0,H1,H1,300,H1,0,H1,H2,_,300,H2,0,H1,300,H2,700,H3,_,_,_,H3,0,H2,300,H1,700,
_,0,H1,H1,300,H1,0,H1,H2,300,_,_,_,0,M5,M5,300,H3,_,H2,_,H1,_,_,_,
_,0,H1,H1,300,H1,0,H1,H2,300,_,0,H2,H2,H1,300,M7,700,H1,_,_,_,_,_,_,_,
};
for (auto i : hktk) {
if (i == LOW_SPEED || i == HIGH_SPEED || i == MIDDLE_SPEED) {
sleep = i;//Sleep(i/2);
continue;
}
if (i == 0) { sleep = 200; continue; }
if (i == 700) { Sleep(200); continue; }
if (i == _) {
Sleep(400);
continue;
}
if (i == 1000) { tmp = +5; continue; }
// if (i == 900) volume += 100;
voice = (volume << 16) + ((i + tmp) << 8) + 0x90;
midiOutShortMsg(handle, voice);
cout << voice << endl;
Sleep(sleep);
}
midiOutClose(handle);
}
int main()
{
HKTK();
return 0;
}
2.3 起风了
#include <iostream>
#include <Windows.h>
#pragma comment(lib,"winmm.lib")
using namespace std;
/*
作者:子任-逸仙
*/
enum Scale
{
Rest = 0, C8 = 108, B7 = 107, A7s = 106, A7 = 105, G7s = 104, G7 = 103, F7s = 102, F7 = 101, E7 = 100,
D7s = 99, D7 = 98, C7s = 97, C7 = 96, B6 = 95, A6s = 94, A6 = 93, G6s = 92, G6 = 91, F6s = 90, F6 = 89,
E6 = 88, D6s = 87, D6 = 86, C6s = 85, C6 = 84, B5 = 83, A5s = 82, A5 = 81, G5s = 80, G5 = 79, F5s = 78,
F5 = 77, E5 = 76, D5s = 75, D5 = 74, C5s = 73, C5 = 72, B4 = 71, A4s = 70, A4 = 69, G4s = 68, G4 = 67,
F4s = 66, F4 = 65, E4 = 64, D4s = 63, D4 = 62, C4s = 61, C4 = 60, B3 = 59, A3s = 58, A3 = 57, G3s = 56,
G3 = 55, F3s = 54, F3 = 53, E3 = 52, D3s = 51, D3 = 50, C3s = 49, C3 = 48, B2 = 47, A2s = 46, A2 = 45,
G2s = 44, G2 = 43, F2s = 42, F2 = 41, E2 = 40, D2s = 39, D2 = 38, C2s = 37, C2 = 36, B1 = 35, A1s = 34,
A1 = 33, G1s = 32, G1 = 31, F1s = 30, F1 = 29, E1 = 28, D1s = 27, D1 = 26, C1s = 25, C1 = 24, B0 = 23,
A0s = 22, A0 = 21
};
enum Voice
{
X1 = C2, X2 = D2, X3 = E2, X4 = F2, X5 = G2, X6 = A2, X7 = B2,
L1 = C3, L2 = D3, L3 = E3, L4 = F3, L5 = G3, L6 = A3, L7 = B3,
M1 = C4, M2 = D4, M3 = E4, M4 = F4, M5 = G4, M6 = A4, M7 = B4,
H1 = C5, H2 = D5, H3 = E5, H4 = F5, H5 = G5, H6 = A5, H7 = B5,
LOW_SPEED = 500, MIDDLE_SPEED = 400, HIGH_SPEED = 300,
_ = 0XFF
};
void Wind()
{
HMIDIOUT handle;
midiOutOpen(&handle, 0, 0, 0, CALLBACK_NULL);
// midiOutShortMsg(handle, 2 << 8 | 0xC0);
int volume = 0x7f;
int voice = 0x0;
int sleep = 350;
int wind[] =
{
400,0,L7,M1,M2,M3,300,L3,0,M5,M3,300,L2,L5,2,_,0,L7,M1,M2,M3,300,L2,0,M5,M3,M2,M3,M1,M2,L7,M1,300,L5,0,L7,M1,M2,M3,300,L3,0,M5,M3,300,L2,L5,2,_,0,L7,M1,M2,M3,300,L2,0,M5,M3,M2,M3,M1,M2,L7,M1,300,L5,
0,L7,M1,M2,M3,300,L3,0,M5,M3,300,L2,L5,2,_,0,L7,M1,M2,M3,300,L2,0,M5,M3,M2,M3,M1,M2,L7,M1,300,L5,0,L7,M1,M2,M3,300,L3,0,M5,M3,300,L2,L5,2,_,
0,M6,M3,M2,L6,M3,L6,M2,M3,L6,_,_,_,
M2,700,0,M1,300,M2,700,0,M1,300,M2,M3,M5,0,M3,700,300,M2,700,0,M1,300,M2,700,0,M1,M2,M3,M2,M1,300,L5,_,
M2,700,0,M1,300,M2,700,0,M1,300,M2,M3,M5,0,M3,700,300,M2,700,0,M3,300,M2,0,M1,700,300,M2,_,_,_,
M2,700,0,M1,300,M2,700,0,M1,300,M2,M3,M5,0,M3,700,300,M2,700,0,M3,300,M2,0,M1,700,300,L6,_,
0,M3,M2,M1,M2,300,M1,_,0,M3,M2,M1,M2,300,M1,700,0,L5,M3,M2,M1,M2,300,M1,_,_,_,
M1,M2,M3,M1,M6,0,M5,M6,300,_,700,0,M1,300,M7,0,M6,M7,300,_,_,M7,0,M6,M7,300,_,M3,0,H1,H2,H1,M7,300,M6,M5,M6,0,M5,M6,_,M5,M6,M5,300,M6,0,M5,M2,300,_,0,M5,700,300,M3,_,_,_,
M1,M2,M3,M1,M6,0,M5,M6,300,_,700,0,M1,300,M7,0,M6,M7,300,_,_,M7,0,M6,M7,300,_,M3,0,H1,H2,H1,M7,300,M6,M5,M6,0,H3,H3,300,_,M5,M6,0,H3,H3,300,_,0,M5,700,300,M6,_,_,_,_,_,
H1,H2,H3,0,H6,H5,300,_,0,H6,H5,300,_,0,H6,H5,300,_,0,H2,H3,300,H3,0,H6,H5,300,_,0,H6,H5,300,_,0,H6,H5,300,_,0,H2,H3,300,H2,0,H1,M6,300,_,0,H1,H1,300,H2,0,H1,300,M6,700,0,_,300,H1,700,H3,_,0,H3,H4,H3,H2,H3,300,H2,700,
H1,H2,H3,0,H6,H5,_,H6,H5,_,H6,H5,300,_,H3,H3,0,H6,H5,_,H6,H5,_,H6,H5,700,300,H3,700,H2,0,H1,M6,700,300,
H3,700,H2,0,H1,300,M6,700,H1,H1,_,_,_,_,_,
0,M6,300,H3,700,H2,0,H1,M6,700,300,H3,H2,700,300,0,H1,M6,300,700,H1,H1,_,_,
0,L7,M1,M2,M3,300,L3,0,M5,M3,300,L2,L5,2,_,0,L7,M1,M2,M3,300,L2,0,M5,M3,M2,M3,M1,M2,L7,M1,300,L5,0,L7,M1,M2,M3,300,L3,0,M5,M3,300,L2,L5,2,_,
0,M6,M3,M2,L6,M3,L6,M2,M3,L6,_,_,_,
M2,700,0,M1,300,M2,700,0,M1,300,M2,M3,M5,0,M3,700,300,M2,700,0,M1,300,M2,700,0,M1,M2,M3,M2,M1,300,L5,_,
M2,700,0,M1,300,M2,700,0,M1,300,M2,M3,M5,0,M3,700,300,M2,700,0,M3,300,M2,0,M1,700,300,M2,_,_,_,
M2,700,0,M1,300,M2,700,0,M1,300,M2,M3,M5,0,M3,700,300,M2,700,0,M3,300,M2,0,M1,700,300,L6,_,
0,M3,M2,M1,M2,300,M1,_,0,M3,M2,M1,M2,300,M1,700,0,L5,M3,M2,M1,M2,300,M1,_,_,_,
M1,M2,M3,M1,M6,0,M5,M6,300,_,700,0,M1,300,M7,0,M6,M7,300,_,_,M7,0,M6,M7,300,_,M3,0,H1,H2,H1,M7,300,M6,M5,M6,0,M5,M6,_,M5,M6,M5,300,M6,0,M5,M2,300,_,0,M5,700,300,M3,_,_,_,
M1,M2,M3,M1,M6,0,M5,M6,300,_,700,0,M1,300,M7,0,M6,M7,300,_,_,M7,0,M6,M7,300,_,M3,0,H1,H2,H1,M7,300,M6,M5,M6,0,H3,H3,300,_,M5,M6,0,H3,H3,300,_,0,M5,700,300,M6,_,_,_,_,_,
H1,H2,H3,0,H6,H5,300,_,0,H6,H5,300,_,0,H6,H5,300,_,0,H2,H3,300,H3,0,H6,H5,300,_,0,H6,H5,300,_,0,H6,H5,300,_,0,H2,H3,300,H2,0,H1,M6,300,_,0,H1,H1,300,H2,0,H1,300,M6,700,0,_,300,H1,700,H3,_,0,H3,H4,H3,H2,H3,300,H2,700,
H1,H2,H3,0,H6,H5,_,H6,H5,_,H6,H5,300,_,H3,H3,0,H6,H5,_,H6,H5,_,H6,H5,700,300,H3,700,H2,0,H1,M6,700,300,
H3,700,H2,0,H1,300,M6,700,H1,H1,_,_,_,_,_,
H1,H2,H3,0,H6,H5,300,_,0,H6,H5,300,_,0,H6,H5,300,_,0,H2,H3,300,H3,0,H6,H5,300,_,0,H6,H5,300,_,0,H6,H5,300,_,0,H2,H3,300,H2,0,H1,M6,300,_,0,H1,H1,300,H2,0,H1,300,M6,700,0,_,300,H1,700,H3,_,0,H3,H4,H3,H2,H3,300,H2,700,
H1,H2,H3,0,H6,H5,_,H6,H5,_,H6,H5,300,_,H3,H3,0,H6,H5,_,H6,H5,_,H6,H5,700,300,H3,700,H2,0,H1,M6,700,300,
H3,700,H2,0,H1,300,M6,700,H1,H1,_,_,_,_,_,
H1,H2,H3,0,H6,H5,300,_,0,H6,H5,300,_,0,H6,H5,300,_,0,H2,H3,300,H3,0,H6,H5,300,_,0,H6,H5,300,_,0,H6,H5,300,_,0,H2,H3,300,H2,0,H1,M6,300,_,0,H1,H1,300,H2,0,H1,300,M6,700,0,_,300,H1,700,H3,_,0,H3,H4,H3,H2,H3,300,H2,700,
H1,H2,H3,0,H6,H5,_,H6,H5,_,H6,H5,300,_,H3,H3,0,H6,H5,_,H6,H5,_,H6,H5,700,300,H3,700,H2,0,H1,M6,700,300,
H3,700,H2,0,H1,300,M6,700,H1,H1,_,_,_,_,_,
0,M6,300,H3,700,H2,0,H1,M6,700,300,H3,H2,700,300,0,H1,M6,300,700,H1,H1,_,_,_,_,_,_,_,
};
for (auto i : wind) {
if (i == 0) { sleep = 175; continue; }
if (i == 700) { Sleep(175); continue; }
if (i == 300) { sleep = 350; continue; }
if (i == _) {
Sleep(350);
continue;
}
// if (i == 900) volume += 100;
voice = (volume << 16) + ((i) << 8) + 0x90;
midiOutShortMsg(handle, voice);
cout << voice << endl;
Sleep(sleep);// midiOutShortMsg(handle, 0x7BB0);
}
midiOutClose(handle);
}
int main()
{
Wind();
return 0;
}
2.4 光阴的故事
#include <iostream>
#include <Windows.h>
#pragma comment(lib,"winmm.lib")
using namespace std;
/*
作者:子任-逸仙
*/
enum Scale
{
Rest = 0, C8 = 108, B7 = 107, A7s = 106, A7 = 105, G7s = 104, G7 = 103, F7s = 102, F7 = 101, E7 = 100,
D7s = 99, D7 = 98, C7s = 97, C7 = 96, B6 = 95, A6s = 94, A6 = 93, G6s = 92, G6 = 91, F6s = 90, F6 = 89,
E6 = 88, D6s = 87, D6 = 86, C6s = 85, C6 = 84, B5 = 83, A5s = 82, A5 = 81, G5s = 80, G5 = 79, F5s = 78,
F5 = 77, E5 = 76, D5s = 75, D5 = 74, C5s = 73, C5 = 72, B4 = 71, A4s = 70, A4 = 69, G4s = 68, G4 = 67,
F4s = 66, F4 = 65, E4 = 64, D4s = 63, D4 = 62, C4s = 61, C4 = 60, B3 = 59, A3s = 58, A3 = 57, G3s = 56,
G3 = 55, F3s = 54, F3 = 53, E3 = 52, D3s = 51, D3 = 50, C3s = 49, C3 = 48, B2 = 47, A2s = 46, A2 = 45,
G2s = 44, G2 = 43, F2s = 42, F2 = 41, E2 = 40, D2s = 39, D2 = 38, C2s = 37, C2 = 36, B1 = 35, A1s = 34,
A1 = 33, G1s = 32, G1 = 31, F1s = 30, F1 = 29, E1 = 28, D1s = 27, D1 = 26, C1s = 25, C1 = 24, B0 = 23,
A0s = 22, A0 = 21
};
enum Voice
{
X1 = C2, X2 = D2, X3 = E2, X4 = F2, X5 = G2, X6 = A2, X7 = B2,
L1 = C3, L2 = D3, L3 = E3, L4 = F3, L5 = G3, L6 = A3, L7 = B3,
M1 = C4, M2 = D4, M3 = E4, M4 = F4, M5 = G4, M6 = A4, M7 = B4,
H1 = C5, H2 = D5, H3 = E5, H4 = F5, H5 = G5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,M5,H2,_,H3,H1,_,_,_,_,_,
M5,M5,M5,M6,_,M5,M3,M3,M2,M3,M1,M3,H1,H1,M6,H1,_,M6,M5,_,_,_,_,_,
H1,H1,M6,H1,_,M6,M5,M6,M5,M5,M1,M3,M5,M5,M6,M5,_,M3,M2,_,_,_,_,_,
M5,M5,M5,M6,_,M5,M3,M3,M2,M3,M1,M3,H1,H1,M6,H1,_,M6,M5,_,_,_,_,_,
H1,H1,M6,H1,_,M6,M5,M5,M6,M5,M1,M3,H1,H1,H1,M6,M7,H1,H2,_,_,_,_,_,
H1,H1,H1,H1,M7,M6,M5,M5,M5,M5,M4,M3,M4,M4,M4,M6,M5,M4,M3,_,_,M3,_,_,
};
for (auto i : gy) {
if (i == 0) { sleep = 150; continue; }
if (i == 700) { Sleep(150); continue; }
if (i == _) {
Sleep(300);
continue;
}
if (i == 300) { sleep = 300; continue; }
voice = (volume << 16) + ((i + tmp) << 8) + 0x90;
midiOutShortMsg(handle, voice);
cout << voice << endl;
Sleep(sleep);//midiOutShortMsg(handle, 0x7BB0);
}
midiOutClose(handle);
}
int main()
{
GY();
return 0;
}
2.5 第一次爱的人
#include <iostream>
#include <Windows.h>
#pragma comment(lib,"winmm.lib")
#include <thread>
#define PLAY(melody, channel) for (unit i : melody) { play(handle, i, channel);}
using namespace std;
/*
作者:无心凌云
*/
enum Volume {
LV = 0x5f, MV = 0x6f, HV = 0x7f
};
enum Scale
{
Rest = 0, C8 = 108, B7 = 107, A7s = 106, A7 = 105, G7s = 104, G7 = 103, F7s = 102, F7 = 101, E7 = 100,
D7s = 99, D7 = 98, C7s = 97, C7 = 96, B6 = 95, A6s = 94, A6 = 93, G6s = 92, G6 = 91, F6s = 90, F6 = 89,
E6 = 88, D6s = 87, D6 = 86, C6s = 85, C6 = 84, B5 = 83, A5s = 82, A5 = 81, G5s = 80, G5 = 79, F5s = 78,
F5 = 77, E5 = 76, D5s = 75, D5 = 74, C5s = 73, C5 = 72, B4 = 71, A4s = 70, A4 = 69, G4s = 68, G4 = 67,
F4s = 66, F4 = 65, E4 = 64, D4s = 63, D4 = 62, C4s = 61, C4 = 60, B3 = 59, A3s = 58, A3 = 57, G3s = 56,
G3 = 55, F3s = 54, F3 = 53, E3 = 52, D3s = 51, D3 = 50, C3s = 49, C3 = 48, B2 = 47, A2s = 46, A2 = 45,
G2s = 44, G2 = 43, F2s = 42, F2 = 41, E2 = 40, D2s = 39, D2 = 38, C2s = 37, C2 = 36, B1 = 35, A1s = 34,
A1 = 33, G1s = 32, G1 = 31, F1s = 30, F1 = 29, E1 = 28, D1s = 27, D1 = 26, C1s = 25, C1 = 24, B0 = 23,
A0s = 22, A0 = 21
};
enum MajorD
{
X1 = D2, X2 = E2, X3 = F2s, X4 = G2, X5 = A2, X6 = B2, X7 = C3s,
L1 = D3, L2 = E3, L3 = F3s, L4 = G3, L5 = A3, L6 = B3, L7 = C4s,
M1 = D4, M2 = E4, M3 = F4s, M4 = G4, M5 = A4, M6 = B4, M7 = C5s,
H1 = D5, H2 = E5, H3 = F5s, H4 = G5, H5 = A5, H6 = B5, H7 = C6s,
_ = 0XFF
};
enum MajorE
{
EX1 = E2, EX2 = F2s, EX3 = G2s, EX4 = A2, EX5 = B2, EX6 = C3s, EX7 = D3s,
EL1 = E3, EL2 = F3s, EL3 = G3s, EL4 = A3, EL5 = B3, EL6 = C4s, EL7 = D4s,
EM1 = E4, EM2 = F4s, EM3 = G4s, EM4 = A4, EM5 = B4, EM6 = C5s, EM7 = D5s,
EH1 = E5, EH2 = F5s, EH3 = G5s, EH4 = A5, EH5 = B5, EH6 = C5s, EH7 = D6s,
};
enum Beat
{
beat = 2500, bd2 = beat / 2, bd4 = beat / 4, bd8 = beat / 8, bd16 = beat / 16, bd32 = beat / 32
};
struct unit {
int pitch;
int time = bd8;
string lyrics = "";
int volume = MV;
};
void play(HMIDIOUT handle, unit u, int channel) {
int sleep = u.time;
int pitch = u.pitch;
string lyrics = u.lyrics;
int volume = u.volume;
if (pitch != _) {
int a = volume;
int b = pitch;
int voice = (a << 16) + ((b) << 8) + 0x90 + channel;
midiOutShortMsg(handle, voice);
}
if (lyrics != "") {
cout << lyrics;
}
if (sleep != 0) {
Sleep(sleep);
}
}
unit main_melody1[] = {
//第一段
{ M1,0,"\n第 " }, { X6,bd8 }, { L3,bd8 }, { L6,bd8 }, { L3,bd8 },
{ M2,bd8 }, { L4,bd8 }, { M1,bd8 }, { L3,bd8 }, { L7,0,"一 " }, { X5,bd8 }, { L2,bd8 }, { L5,bd8 }, { L2,bd8 },
{ M1,bd8 }, { L3,bd8 }, { L7,bd8 }, { L2,bd8 }, { L6,0,"次 " }, { X4,bd8 }, { L1,bd8 }, { L4,bd8 }, { L1,bd8 },
{ L6 }, { L2 }, { L4 }, { L2 }, { L7,0,"爱 " }, { X3 }, { X7 }, { L6,0,"的 " }, { L2 }, { L5 + 1,0, "人\n\n" }, { L3,bd8 + bd4 * 2 },
{ M1,0 }, { X6,bd8 }, { L3,bd8 }, { L6,bd8 }, { L3,bd8 },
{ M2,bd8 }, { H4,0,"",HV }, { L4,bd8 }, { H3,0,"",HV }, { M1,bd8 }, { H2,0,"",HV }, { L3,bd8 }, { H2,0,"",HV }, { L7,0 }, { X5,bd8 }, { L2,bd8 }, { L5,bd8 }, { L2,bd8 },
{ M1,bd8 }, { L3,bd8 }, { L7,bd8 }, { L2,bd8 }, { L6,0 }, { X4,bd8 }, { L1,bd8 }, { L4,bd8 }, { H2,0,"",HV }, { L1,bd8 },
{ H1,0,"",HV }, { L6 }, { L2 }, { L4 }, { L2 }, { L7,0 }, { X3 }, { X7 }, { L6,0 }, { L2 }, { L5 + 1,0 }, { L3,bd8 + bd8 }, { H4,bd8,"灰",HV }, { H3,bd8,"色",HV }, { H1,bd8,"的",HV },
{ M6,0,"天 ",HV }, { M1,0 }, { X6,bd8 }, { L3,bd8 }, { L6,bd8 }, { L3,bd8 },
{ M2,bd8 }, { H4,0,"你",HV }, { L4,bd8 }, { H3,0,"的",HV }, { M1,bd8 }, { H2,0,"脸\n",HV }, { L3,bd8 }, { L7,0 }, { X5,bd8 }, { L2,bd8 }, { L5,bd8 }, { L2,bd8 },
{ M1,bd8 }, { H3,0,"爱",HV }, { L3,bd8 }, { H2,0,"过",HV }, { L7,bd8 }, { M7,0,"也",HV }, { L2,bd8 }, { H1,0,"哭",HV }, { L6,0 }, { X4,bd8 }, { M6,0,"过",HV }, { L1,bd8 }, { H1,0,"笑",HV }, { L4,bd8 }, { M6,0,"过",HV }, { L1,bd8 },
{ H1,0,"痛",HV }, { L6 }, { M6,0,"过",HV }, { L2 }, { H1,0,"之",HV }, { L4 }, { M6,0,"后",HV }, { L2 }, { H2,0,"只",HV }, { L7,0 }, { X3 }, { H2,0,"剩",HV }, { X7 }, { H1,0,"再",HV }, { L6,0 }, { L2 }, { M7,0,"见\n",HV }, { L5 + 1,0 }, { L3,bd8 + bd8 }, { H4,bd8,"我",HV }, { H3,bd8,"的",HV }, { H1,bd8,"眼",HV },
{ M6,0,"泪 ",HV }, { M1,0 }, { X6 }, { L3 }, { L6 }, { L3 },
{ M2 }, { H4,0,"湿",HV }, { L4 }, { H3,0,"了",HV }, { M1 }, { H2,0,"脸\n",HV }, { L3 }, { H2,0,"",HV }, { L7,0 }, { X5 }, { L2 }, { L5 }, { L2 },
{ M1 }, { H3,0,"失",HV }, { L3 }, { H2,0,"去",HV }, { L7 }, { M7,0,"第",HV }, { L2 }, { H1,0,"一",HV }, { L6,0 }, { X4 }, { M6,0,"次",HV }, { L1 }, { H1,0,"爱",HV }, { L4 }, { M6,0,"的",HV }, { L1 },
{ H1,0,"人",HV }, { L6 }, { M6,0,"竟",HV }, { L2 }, { H1,0,"然",HV }, { L4 }, { M6,0,"是",HV }, { L2 }, { H2,0,"这",HV }, { L7,0 }, { X3 }, { H2,0,"种",HV }, { X7 }, { H1,0,"感",HV }, { L6,0 }, { L2 }, { H3,0,"觉\n",HV }, { L5 + 1,0 }, { L3,bd8 },
{ _,bd8 }, { H3,bd8,"总",HV }, { H3,bd8,"以",HV }, { H3,0,"为 ",HV }, { L5 + 1,0 }, { L3 }, { L1 }, { H3,0,"爱",HV }, { L3 }, { H3,0,"是",HV }, { L5 + 1,bd8 },{H1,bd8,"全",HV},
{ H2,0,"部",HV }, { X5 }, { H3,0,"的",HV }, { X7 }, { H4,0,"心",HV }, { L2,bd8 }, { H3,bd8,"跳\n",HV }, { X6,bd8 }, { H1,0,"失",HV }, { L1 }, { L3,0 }, { H1,bd8,"去",HV }, { M6,bd8,"爱",HV },
{ M7,0,"我",HV }, { L3 }, { H1,0,"们",HV }, { L5 }, { H2,0,"就",HV }, { L7,bd8 }, { H3,bd8,"要",HV }, { H1,0," ",HV }, { L4 }, { L6 }, { H2,0,"就",HV }, { M1 }, { H1,bd8,"要\n",HV },
{ X6 }, { M6,0,"一",HV }, { L1 }, { M6,0,"点",HV }, { L3 }, { M6,bd8,"点",HV }, { H3,0,"慢",HV }, { L7,0 }, { L5,0 }, { L3 }, { H4,0,"慢",HV }, { L7,0 }, { L5,0 }, { L3 }, { H5,0,"地",HV }, { L7,0 }, { L5,0 }, { L3 }, { H3,0,"死",HV }, { L7,0 }, { L5,0 }, { L3 },
{ H2,0,"掉\n",HV }, { L7,0 }, { L5,0 }, { L2 }, { L7,0 }, { L5,0 }, { L2 }, { L7,0 }, { L5,0 }, { L2 }, { M5,0,"当",HV }, { L7,0 }, { L5,0 }, { L2 }, { H5,0,"我 ",HV }, { M3,0 }, { M1,0 }, { L5 ,bd4 + bd8}, /*{_,bd16},/*{ H3,bd16,"",HV },{ M3,0 }, { M1,0 }, { L5,bd16 + bd8 },*/ { H3,0,"失",HV }, { M3,0 }, { M1,0 }, { L5 },
{ H4,0,"去",HV }, { L1 }, { H6,0,"你",HV }, { X5,bd16 }, { L1,bd16 }, { H5,0,"那",HV }, { X7 }, { H4,0,"一",HV }, { X5,bd16 }, { H3,0,"秒 ",HV }, { X7,bd16 }, /*{ H3,0," ",HV },*/ { X6,bd8 + bd16 }, { X6,bd8 }, { _,bd16 }, { H3,0,"心",HV }, { X6 },
{ H3,bd8,"突",HV }, { H4,0,"然",HV }, { X6 }, { H3,0,"就",HV }, { X5 }, { H2,bd16,"变",HV }, { H1,bd16,"老\n",HV }, /*{ H1,0,"\n",HV },*/ { X4,bd8 + bd16 }, { X4,bd16 }, { _,bd8 }, { M6,0,"The ",HV }, { X4 },
{ H1,bd8,"day ",HV }, { H2,0,"you ",HV }, { X4 }, { H3,0,"went ",HV }, { X5 }, { H4,bd16,"",HV }, { H3,bd16,"away\n",HV }, /*{ H3,0,"",HV },*/ { L1,bd8 + bd16 }, { L1,bd16 }, { _,bd8 }, { L1,bd4 },
{ H5,0,"喧",HV }, { X5,bd16 }, { X6,bd16 }, { H5,0,"闹",HV }, { L1,bd16 }, { L2,bd16 }, { H3,0,"的",HV }, { L1,bd16 }, { X6,bd16 }, { H5,0,"街 ",HV }, { L1,bd8 + bd16 }, { L1,bd16 }, { _,bd8 }, { H5,0,"没",HV }, { L1 },
{ H5,bd8,"发",HV }, { H6,0,"现",HV }, { X5,bd16 }, { L1,bd16 }, { H5,0,"我",HV }, { X7 }, { H4,0,"的",HV }, { X5,bd16 }, { H3,0,"泪\n",HV }, { X7,bd16 }, /*{ H3,0,"",HV },*/ { X6,bd8 + bd16 }, { X6,bd16 }, { _,bd8 }, { H3,0,"被",HV }, { X6 },
{ H3,bd8,"遗",HV }, { H4,0,"忘",HV }, { X6 }, { H3,0,"在",HV }, { X5 }, { H2,bd16,"街",HV }, { H1,bd16,"角\n",HV }, /*{ H1,0,"\n",HV },*/ { X4,bd8 + bd16 }, { X4,bd16 }, { _,bd8 }, { M6,0,"The ",HV }, { X4 },
{ H1,bd8,"day ",HV }, { H2,0,"you ",HV }, { X4 }, { H3,0,"went ",HV }, { X5 }, { H4,bd8,"away\n\n",HV }, { H3,0,"",HV }, { X6,bd16 }, { H2,bd16 }, { H1,bd4 + bd8 },
{ M1,0,"music" }, { X6 }, { L3 }, { L6 }, { L3 },
{ M2 }, { L4 }, { M1 }, { H1,0,".",HV }, { L3 }, { H2,0,".",HV }, { L7,0 }, { X5 }, { L2 }, { L5 }, { L2 },
{ M1 }, { L3 }, { H3,0,".",HV }, { L7 }, { H2,0,".",HV }, { L2,bd16 }, { H2,bd16,".",HV }, { L6,0,"." }, { X4 }, { H1,0,".",HV }, { L1 }, { L4 }, { L1 },
{ M6,0,".",HV }, { L6 }, { M7,0,".",HV }, { L2 }, { H1,0,".",HV }, { L4 }, { H2,0,".",HV }, { L2 }, { H2,0,".",HV }, { L7,0 }, { X3 }, { X7 }, { L6,0,"." }, { L2 }, { L5 + 1,0,"." }, { L3 },
};
unit main_melody2[] = {
//第二段
{ _,bd8 }, { H4,bd8,"我",HV }, { H3,bd8,"看",HV },/*{L5,0},{L3,0},*/{ H1,bd8,"着",HV }, { M6,0,"你 ",HV }, { M1,0 }, { X6 }, { L3 }, { L6 }, { L3 },
{ M2 }, { H4,0,"走",HV }, { L4 }, { H3,0,"过",HV }, { M1 }, { H2,0,"街\n",HV }, { L3 }, { L7,0 }, { X5 }, { L2 }, { L5 }, { L2 },
{ M1 }, { H3,0,"还",HV }, { L3 }, { H2,0,"穿",HV }, { L7 }, { M7,0,"着",HV }, { L2 }, { H1,0,"去",HV }, { L6,0 }, { X4 }, { M6,0,"年",HV }, { L1 }, { H1,0,"夏",HV }, { L4 }, { M6,0,"天",HV }, { L1 },
{ H1,0,"我",HV }, { L6 }, { M6,0,"送",HV }, { L2 }, { H1,0,"你",HV }, { L4 }, { M6,0,"的",HV }, { L2 }, { H2,0,"那",HV }, { L7,0 }, { X3 }, { H2,0,"双",HV }, { X7 }, { H1,0,"球",HV }, { L6,0 }, { L2 }, { M7,0,"鞋\n",HV }, { L5 + 1,0 }, { L3,bd8 },
{ _,bd8 }, { H4,bd8,"银",HV }, { H3,bd8,"色",HV }, { L5 + 1,0 }, { L3,0 }, { H1,bd8,"手",HV }, { M6,0,"链 ",HV }, { M1,0 }, { X6 }, { L3 }, { L6 }, { L3 },
{ M2 }, { H4,0,"还",HV }, { L4 }, { H3,0,"耀",HV }, { M1 }, { H2,0,"眼\n",HV }, { L3 }, { H2,0,"",HV }, { L7,0 }, { X5 }, { L2 }, { L5 }, { L2 },
{ M1 }, { H3,0,"你",HV }, { L3 }, { H2,0,"的",HV }, { L7 }, { M7,0,"世",HV }, { L2 }, { H1,0,"界",HV }, { L6,0 }, { X4 }, { M6,0,"似",HV }, { L1 }, { H1,0,"乎",HV }, { L4 }, { M6,0,"一",HV }, { L1 },
{ H1,0,"点",HV }, { L6 }, { M6,0,"也",HV }, { L2 }, { H1,0,"没",HV }, { L4 }, { M6,0,"有",HV }, { L2 }, { H2,0,"因",HV }, { L7,0 }, { X3 }, { H2,0,"此",HV }, { X7 }, { H1,0,"改",HV }, { L6,0 }, { L2 }, { H3,0,"变\n",HV }, { L5 + 1,0 }, { L3,bd8 },
{ _,bd8 }, { H3,bd8,"总",HV }, { H3,bd8,"以",HV }, { H3,0,"为 ",HV }, { L5 + 1,0 }, { L3 }, { L1 }, { H3,0,"爱",HV }, { L3 }, { H3,0,"是",HV }, { L5 + 1,bd8 }, { H1,bd8,"全",HV },
{ H2,0,"部",HV }, { X5 }, { H3,0,"的",HV }, { X7 }, { H4,0,"心",HV }, { L2,bd8 }, { H3,bd8,"跳\n",HV }, { X6,bd8 }, { H1,0,"失",HV }, { L1 }, { L3,0 }, { H1,bd8,"去",HV }, { M6,bd8,"爱",HV },
{ M7,0,"我",HV }, { L3 }, { H1,0,"们",HV }, { L5 }, { H2,0,"就",HV }, { L7,bd8 }, { H3,bd8,"要",HV }, { H1,0," ",HV }, { L4 }, { L6 }, { H2,0,"就",HV }, { M1 }, { H1,bd8,"要\n",HV },
{ X6 }, { M6,0,"一",HV }, { L1 }, { M6,0,"点",HV }, { L3 }, { M6,bd8,"点",HV }, { H3,0,"慢",HV }, { L7,0 }, { L5,0 }, { L3 }, { H4,0,"慢",HV }, { L7,0 }, { L5,0 }, { L3 }, { H5,0,"地",HV }, { L7,0 }, { L5,0 }, { L3 }, { H3,0,"死",HV }, { L7,0 }, { L5,0 }, { L3 },
{ H2,0,"掉\n",HV }, { L7,0 }, { L5,0 }, { L2 }, { L7,0 }, { L5,0 }, { L2 }, { L7,0 }, { L5,0 }, { L2 }, { M5,0,"当",HV }, { L7,0 }, { L5,0 }, { L2 }, { H5,0,"我 ",HV }, { M3,0 }, { M1,0 }, { L5,bd4 + bd8 },/*{_,bd16},{H3,bd16,"",HV},{M3,0} ,{M1,0},{L5,bd16 + bd8}*/{ H3,0,"失",HV }, { M3,0 }, { M1,0 }, { L5 },
{ H4,0,"去",HV }, { L1 }, { H6,0,"你",HV }, { X5,bd16 }, { L1,bd16 }, { H5,0,"那",HV }, { X7 }, { H4,0,"一",HV }, { X5,bd16 }, { H3,0,"秒 ",HV }, { X7,bd16 },/*{H3,0,"",HV}*/{ X6,bd8 + bd16 }, { X6,bd8 }, { _,bd16 }, { H3,0,"心",HV }, { X6 },
{ H3,bd8,"突",HV }, { H4,0,"然",HV }, { X6 }, { H3,0,"就",HV }, { X5 }, { H2,bd16,"变",HV }, { H1,bd16,"老\n",HV },/*{H1,0,"",HV}*/{ X4,bd8 + bd16 }, { X4,bd16 }, { _,bd8 }, { M6,0,"The ",HV }, { X4 },
{ H1,bd8,"day ",HV }, { H2,0,"you ",HV }, { X4 }, { H3,0,"went ",HV }, { X5 }, { H4,bd16,"",HV }, { H3,bd16,"away\n",HV },/*{H3,0,"",HV},*/{ L1,bd8 + bd16 }, { L1,bd16 }, { _,bd8 }, { L1,bd8 },
{ _,bd8 }, { H5,0,"喧",HV }, { X5,bd16 }, { X6,bd16 }, { H5,0,"闹",HV }, { L1,bd16 }, { L2,bd16 }, { H3,0,"的",HV }, { L1,bd16 }, { X6,bd16 }, { H5,0,"街 ",HV }, { L1,bd8 + bd16 }, { L1,bd16 }, { _,bd8 }, { H5,0,"没",HV }, { L1 },
{ H5,bd8,"发",HV }, { H6,0,"现",HV }, { X5,bd16 }, { L1,bd16 }, { H5,0,"我",HV }, { X7 }, { H4,0,"的",HV }, { X5,bd16 }, { H3,0,"泪\n",HV }, { X7,bd16 },/*H3,0,"",HV}*/{ X6,bd8 + bd16 }, { X6,bd16 }, { _,bd8 }, { H3,0,"被",HV }, { X6 },
{ H3,bd8,"遗",HV }, { H4,0,"忘",HV }, { X6 }, { H3,0,"在",HV }, { X5 }, { H2,bd16,"街",HV }, { H1,bd16,"角\n",HV },/*{H1,0,"",HV},*/{ X4,bd8 + bd16 }, { X4,bd16 }, { _,bd8 }, { M6,0,"The ",HV }, { X4 },
{ H1,bd8,"day ",HV }, { H2,0,"you ",HV }, { X4 }, { H3,0,"went ",HV }, { X5 }, { H4,bd8,"away\n\n",HV }, { H3,0,"",HV }, { X6,bd16 }, { H2,bd16 }, { H1,bd4 }, { H3 },
{ H3,0,"music",HV }, { X6 }, { H2,0,".",HV }, { X6 }, { H2,0,".",HV }, { X5 }, { H1,bd8,".",HV }, { H2,0,".",HV }, { X4,bd16 }, { H1,bd16,"",HV }, { M6,bd16,".",HV }, { X4,bd16 }, { M6,bd8,".",HV }, { M6,0,".",HV }, { X4 },
{ M6,bd16,".",HV }, { X4,bd16 }, { M7,0,".",HV }, { L1,bd16 }, { L2,bd16 }, { H1,0,".",HV }, { L1 }, { H2,0,".",HV }, { X4 }, { M7,0,".",HV }, { X3,bd8 + bd16 }, { X3,bd16 }, { _,bd8 }, { X3 },
{ M1,0,"." }, { X6 }, { L3 }, { L6 }, { L3 },
{ M2 }, { L4 }, { M1 }, { H1,0,".",HV }, { L3 }, { H2,0,".",HV }, { L7,0,"." }, { X5 }, { L2 }, { L5 }, { L2 },
{ M1 }, { L3 }, { H3,0,".",HV }, { L7 }, { H2,0,".",HV }, { L2,bd16 }, { H2,bd16,".",HV }, { H2,0,".",HV }, { L6,0 ,"." }, { X4 }, { H1,0,".",HV }, { L1 }, { L4 }, { L1 },
};
unit main_melody3[] = {
//第三段
{ L6 }, { L2 }, { L4 }, { L2 }, { H3,0,"Wo ",HV }, { L5,0 }, { L3,0 }, { L1 }, { H4,bd8,"",HV }, { H3,bd8,"Wo ",HV }, { H4,0,"",HV }, { L5,0 }, { L3,0 }, { L1 },
{ H3,0,"",HV }, { L5 + 1,0 }, { L3,0 }, { X7 }, { H3,bd8,"总",HV }, { H3,bd8,"以",HV }, { H3,0,"为 ",HV }, { L5 + 1,0 }, { L3,0 }, { X7 }, { L1 }, { H3,0,"爱",HV }, { L3 }, { H3,0,"是",HV }, { L5 + 1 }, { H1,bd8,"全",HV },
{ H2,0,"部",HV }, { X5 }, { H3,0,"的",HV }, { X7 }, { H4,0,"心",HV }, { L2 }, { H3,bd8,"跳\n",HV }, { X6 }, { H1,0,"失",HV }, { L1 }, { H1,0,"去",HV }, { L3 }, { M6,bd8,"爱",HV },
{ M7,0,"我",HV }, { L3 }, { H1,0,"们",HV }, { L5 }, { H2,0,"就",HV }, { L7 }, { H3,bd8,"要",HV }, { H1,0," ",HV }, { L4 }, { L6 }, { H2,0,"就",HV }, { M1 }, { H1,bd8,"要\n",HV },
{ X6 }, { M6,0,"一",HV }, { L1 }, { M6,0,"点",HV }, { L3 }, { M6,bd8,"点",HV }, { H3,0,"慢",HV }, { L7,0 }, { L5,0 }, { L3 }, { H4,0,"慢",HV }, { L7,0 }, { L5,0 }, { L3 }, { H5,0,"地",HV }, { L7,0 }, { L5,0 }, { L3 }, { H3,0,"死",HV }, { L7,0 }, { L5,0 }, { L3 },
{ H2,0,"掉\n",HV }, { L7,0 }, { L5,0 }, { L2 }, { L7,0 }, { L5,0 }, { L2 }, { L7,0 }, { L5,0 }, { L2 }, { M5,0,"当",HV }, { L7,0 }, { L5,0 }, { L2 }, { H5,0,"我 ",HV }, { M3,0 }, { M1,0 }, { L5,bd4 + bd8 },/*{H3,bd16,"",HV},{M3,0},{M1,0},{L5,bd16 + bd8},*/{ H3,0,"失",HV }, { M3,0 }, { M1,0 }, { L5 },
{ H4,0,"去",HV }, { L1 }, { H6,0,"你",HV }, { X5,bd16 }, { L1,bd16 }, { H5,0,"那",HV }, { X7 }, { H4,0,"一",HV }, { X5,bd16 }, { H3,0,"秒\n",HV }, { X7,bd16 },/*{H3,0,"",HV},*/{ X6,bd8 + bd16 }, { X6,bd16 }, { _,bd8 }, { H3,0,"心",HV }, { X6 },
{ H3,bd8,"突",HV }, { H4,0,"然",HV }, { X6 }, { H3,0,"就",HV }, { X5 }, { H2,bd16,"变",HV }, { H1,bd16,"老\n",HV },/*{H1,0,"",HV},*/{ X4,bd8 + bd16 }, { X4,bd16 }, { _,bd8 }, { M6,0,"The ",HV }, { X4 },
{ H1,bd8,"day ",HV }, { H2,0,"you ",HV }, { X4 }, { H3,0,"went ",HV }, { X5 }, { H4,bd16,"away\n",HV }, { H3,bd16,"",HV },/*{H3,0,"",HV},*/{ L1,bd8 + bd16 }, { L1,bd16 }, { _,bd8 }, { L1 },
{ _,bd8 }, { H5,0,"喧",HV }, { X5,bd16 }, { X6,bd16 }, { H5,0,"闹",HV }, { L1,bd16 }, { L2,bd16 }, { H3,0,"的",HV }, { L1,bd16 }, { X6,bd16 }, { H5,0,"街 ",HV }, { L1,bd8 + bd16 }, { L1,bd16 }, { _,bd8 }, { H5,0,"没",HV }, { L1 },
{ H5,bd8,"发",HV }, { H6,0,"现",HV }, { X5,bd16 }, { L1,bd16 }, { H5,0,"我",HV }, { X7 }, { H4,0,"的",HV }, { X5,bd16 }, { H3,0,"泪\n",HV }, { X7,bd16 },/*{H3,0,"",HV},*/{ X6,bd8 + bd16 }, { X6,bd16 }, { _,bd8 }, { H3,0,"被",HV }, { X6 },
{ H3,bd8,"遗",HV }, { H4,0,"忘",HV }, { X6 }, { H3,0,"在",HV }, { X5 }, { H2,bd16,"街",HV }, { H1,bd16,"角\n",HV },/*{H1,0,"",HV},*/{ X4,bd8 + bd16 }, { X4,bd16 }, { _,bd16 }, { M6,0,"The ",HV }, { X4 },
{ H1,bd8,"day ",HV }, { H2,0,"you ",HV }, { X4 }, { H3,0,"went ",HV }, { X5 }, { H4,bd8,"away\n",HV }, { H3,0,"",HV }, { X6,bd16 }, { H2,bd16,"",HV }, { H1,bd8 + bd4,"",HV },
{ _,bd8 }, { H5,0,"有",HV }, { X6 }, { H5,0,"一",HV }, { X5 }, { H3,bd8,"天",HV }, { H6,0,"也",HV }, { L1,bd8 }, { H5,bd16,"许",HV }, { L1,bd16 }, { H3,bd8,"我",HV }, { H6,0,"能",HV }, { L1 },
{ H5,bd8,"把",HV }, { H3,0,"自",HV }, { X5,bd16 }, { L1,bd16 }, { H6,0,"己",HV }, { X7 }, { H5,0,"治",HV }, { X5,bd16 }, { H3,0,"好\n",HV }, { X7,bd16 },/*{H3,0,"",HV},*/{ X6,bd8 + bd16 }, { X6,bd16 }, { _,bd8 }, { H3,0,"再",HV }, { X6 },
{ H3,bd8,"一",HV }, { H4,0,"次",HV }, { X6 }, { H3,0,"想",HV }, { X5 }, { H2,bd16,"起",HV }, { H1,bd16,"来 ",HV },/*{H1,0,"",HV},*/{ X4,bd8 + bd16 }, { X4,bd16 }, { _,bd8 }, { M6,0,"应",HV }, { X4 },
{ H1,bd8,"该",HV }, { H2,0,"要",HV }, { X4 }, { H3,0,"怎",HV }, { X5 }, { H4,bd16,"么",HV }, { H3,bd16,"笑\n",HV },/*{H3,0,"",HV},*/{ L1,bd8 + bd16 }, { L1,bd16 }, { _,bd8 }, { L1 },
{ _,bd8 }, { H5,0,"第",HV }, { X5,bd16 }, { X6,bd16 }, { H5,0,"一",HV }, { L1,bd16 }, { L2,bd16 }, { H3,0,"次",HV }, { L1,bd16 }, { X6,bd16 }, { H6,0,"爱",HV }, { L1 }, { H5,bd16,"的",HV }, { L1,bd16 }, { H3,bd8,"人",HV }, { H6,0,"他",HV }, { L1 },
{ H5,bd8,"的",HV }, { H3,0,"坏",HV }, { X5,bd16 }, { L1,bd16 }, { H6,0,"他",HV }, { X7 }, { H5,0,"的",HV }, { X5,bd16 }, { X7,bd16 }, { H3,0,"好\n",HV }, { X6,bd8 + bd16 }, { X6,bd16 }, { _,bd8 }, { H3,0,"却",HV }, { X6 },
{ H3,bd8,"像",HV }, { H4,0,"胸",HV }, { X6 }, { H3,0,"口",HV }, { X5 }, { H2,bd16,"刺",HV }, { H1,bd16,"青 ",HV },/*{H1,0,"",HV},*/{ X4,bd8 + bd16 }, { X4,bd16 }, { _,bd16 }, { M6,0,"是",HV }, { X4 },
{ H1,bd8,"永",HV }, { H2,0,"远",HV }, { X4 }, { H3,0,"的",HV }, { X5 }, { H4,bd16,"记",HV }, { H3,bd16,"号\n",HV },/*{H3,0,"",HV},*/{ X6,bd8 + bd16 }, { X6,bd16 }, { _,bd16 }, { H3,0,"跟",HV }, { X6 },
{ H3,bd8,"着",HV }, { H2,0,"我",HV }, { X6 }, { H2,0,"的",HV }, { X5 }, { H1,bd8,"呼",HV }, { H2,0,"吸 ",HV }, { X4,bd8 }, { H1,bd4 + bd16,"",HV },/*{M6,bd16,"",HV},*//*{X4,bd4},*/{ M6,0,"直",HV }, { X4 },
{ M6,bd16,"到",HV }, { X4,bd16 }, { M7,0,"停",HV }, { L1,bd16 }, { L2,bd16 }, { H1,0,"止",HV }, { L1 }, { H2,0,"心",HV }, { X4 }, { M7,0,"跳\n\n",HV }, { X3,bd8 + bd16 }, { X3,bd16 }, { _,bd8 }, { X3 },
第四段
{ M1, 0 ,"music"}, { X6 }, { L3 }, { L6 }, { L3 },
{ M2 }, { L4 }, { M1 }, { L3 }, { L7,0 ,"." }, { X5 }, { L2 }, { L5 }, { L2 }, { M1 }, { L3 }, { L7 }, { L2 },
{ L6, 0 ,"." }, { X4 }, { L1 }, { L4 }, { EL1 }, { L6 }, { L2 }, { L4 }, { L2 },
{ L7, 0 ,"." }, { X3 }, { X7 }, { L6,0 , "." }, { L2 }, { L5 + 1,0 , "." }, { L3 }, { _,bd4 + bd4 },
};
void play_main(HMIDIOUT handle) {
midiOutShortMsg(handle, 0 * 0x100 + 0xC0);
PLAY(main_melody1, 0);
system("cls");
cout << "\n第 一 次 爱 的 人\n\n";
PLAY(main_melody2, 0);
system("cls");
cout << "\n第 一 次 爱 的 人\n\n";
PLAY(main_melody3, 0);
cout << "end";
}
int main()
{
HMIDIOUT handle;
midiOutOpen(&handle, 0, 0, 0, CALLBACK_NULL);
Sleep(1000);
play_main(handle);
midiOutClose(handle);
return 0;
}
3.typora的导出
3.1 导出为pdf
3.2 导出为word文档
3.2.1 下载与安装pandoc
安装包在百度网盘的链接:https://pan.baidu.com/s/1LUodcD7xY_9OQefHVHot7Q
提取码:1314
3.2.2 typora配置pandoc
配置完毕,重启 typora
3.2.3 导出为word
3.3 📍 作业展示
-
pdf格式文档图片
-
word格式文档图片
4.github注册登录与typora主题获取
4.0 说明
4.0.1 GitHub简介
-
全球最大同性交友网站,技术宅男的天堂,新世界的大门。
-
GitHub是一个代码托管云服务网站,主要用于软件开发者存储和管理其项目源代码,且能够追踪、记录并控制用户对其代码的修改。
-
甚至你可以简单粗暴的把它当作一个网盘,用来存储任何东西。
4.0.2 Github能给你带来什么
1️⃣ 托管代码、历史版本管理
当然不仅仅是代码,任何文件都支持(不少人用GitHub来写博客)。它会自动帮你记录代码的修改,在必要的时候,能够帮助你快速回退到之前的历史版本。
2️⃣ 搜索开源项目
GitHub是世界顶级开发者的聚集地,在这里你几乎可以找到任何你想要的东西。上面分享有许多优秀、著名的开源项目,在遵守其License的前提下,你可以免费使用、下载这些开源项目。这也是GitHub最为吸引人的地方。
👉看看GitHub开源项目排行榜:https://www.githubs.cn/top
👉正在使用GitHub的企业与组织:https://www.githubs.cn/organizations
3️⃣ 分享的同时会得到社区的回馈
GitHub可以说是共产主义的最佳实践之一。其一大优势是协同开发,你分享出来的项目,其他开发者也可以参与贡献,帮助你一同完善项目功能,Bug修复,代码质量提升。
4️⃣ 使用Github Pages服务,你可以免费搭建一个博客网站
GitHub Pages
提供静态网页托管服务,它直接从 GitHub 上的仓库获取 HTML
、CSS
和 JavaScript
文件,然后构建并发布网站。 您可以在 GitHub Pages 示例集合中查看 GitHub Pages 站点的示例。
GitHub 提供免费的 github.io
子域,也支持自定义域名。
5️⃣ 学习,能力提升
GitHub上有很多优秀开源项目和教程资源值得你去发现、学习
👉GitHub面试、学习资源精选:https://www.githubs.cn/awesome
6️⃣ 提升自己的影响力
你可以将自己的开源项目发布到GitHub网站上,项目越受欢迎获得的Star越高,说明业界对你的能力越认可。一份优秀的GitHub主页,能为自己的简历润色不少。
4.1 github网址填写邮箱
由于访问外网,所以访问可能会比较慢,因此建议使用自己的热点。
🏠https://github.com/
4.2 设置密码(包含字母大小写和数字)
4.3 设置英文用户名
4.4 选择是否接受消息推送
4.5 真人验证
点击 create account
后可能会有点卡,显示错误的白色页面,你如下图点击刷新
按钮,然后会弹出一个选择对话框,按继续
即可
4.6 邮箱验证
4.7 信息填写
4.8 注册成功
4.9 获取typora主题
在左上角的搜索框中输入:Mr-Write/-
解压后将 theme 文件夹下的所有文件拷贝至 typora的主题文件夹
下即可(这个在之前已经讲过了,这里就不过多说明)
4.10 📍 作业展示
👇 展示 cyan-moon 主题的效果图
5.函数练习
5.1 📍 求和
编写一个求和函数sum,用于计算 1+2+…+n ,在主函数调用该函数求和。
示例 | 输入 | 输出 |
---|---|---|
1️⃣ | 5 | 15 |
2️⃣ | 7 | 28 |
3️⃣ | 3 | 6 |
👇 代码写在代码块中
👇 vs执行代码成功截图放在引用框中
5.2 📍 回文数
编写函数 palindromeNumber,求[200,3000]
范围内的回文数有哪些,在主函数中调用该函数。
输出区间[200,3000]
中所有的回文数,一行一个回文数,不需要输出其它无关的字符。
202
212
222
232
242
.....
👇 代码写在代码块中
👇 vs执行代码成功截图放在引用框中
5.3 📍 函数表达式的值
有如下表达式 s = 1 + 1 / 3 + (1 * 2) / (3 * 5) + (1 * 2 * 3) / (3 * 5 * 7) + .... + (1 * 2 * 3 * .... * n) / (3 * 5 * 7 * ... * (2 * n + 1))
。编写函数求给出的n所对应的表达式s的值。
输出表达式的值,保留小数点后10位的值。
示例 | 输入 | 输出 |
---|---|---|
1️⃣ | 4 | 1.5492063492 |
2️⃣ | 3 | 1.5238095238 |
👇 代码写在代码块中
👇 vs执行代码成功截图放在引用框中
6.写一篇自己的csdn文章
6.1 选题范围
- 选题一:自己对编程的看法与感悟,可以是注意的问题,可以是自己从小白到现在的成长,自由发挥(不低于两百字)
- 选题二:本次练习的三道函数练习题,
任选一道
作为文章发布
6.2 编写步骤
-
先在 typora 中完成编写
-
打开csdn编辑器
-
将 typora 中的编写内容
全选
,然后复制
,再粘贴
到csdn编辑框(如果包含图片则图片路径不能使用本地路径) -
发布文章
-
发布成功
-
审核完成一段时间后,进入个人主页查看
-
链接复制与分析
6.3 📍 分享
到这里,一篇文章就诞生了。这样,我就可以分享链接
给我爱的人看我的故事了。
👇 在下方引用栏写下文章链接,给你的负责人查看
🏠
7.总结
7.1 个人学习总结
在下面写下你对这次任务学习到的知识的总结,我们会根据你的总结给你打分(学习总结)
7.2 对软件协会的评价与建议
💬 我的一些话:
- 软件协会成立时间不算长,但发展的很快,一百多号人的社团确实在管理起来有许多可能的疏忽或者没有全部照顾的到,有些小伙伴觉得没有学到什么。但学习永远不能成为一个被动的过程,一定是要自己去主动去争取。
- 软件协会的制度与学习规划也在不断完善,大家都应该是在慢慢变得更好变得优秀才对。软件协会提供了许多好的学习资源与更多的拓展,我们也不是老师总是催着小伙伴们做这做那,所以我们给了,你必须主动去接受。
- 之前有些小伙伴和我交流的时候说自己会为学校之间的差别感到焦虑,但其实计算机专业差别真不会太大,大多都是靠自己的主动学习,即使是学校老师的差距也几乎影响不了什么。再者,软协提供的资料与知识拓展都是走在了很多其它学校的前面,像我有在其它很多高校的同学,他们现在都不知道github怎么用,typora怎么用,图床是什么。软件协会对大一的学习规划是在同样学习的知识的基础上进行知识的拓展或者说是超前学习。
不管怎样,请在下方写下你对软件协会的评价,做的好的与做的不好的,供软件协会改进。