超炫彩的生日快乐祝福C语言代码
功能
代码
替换代码中字符串中出现的人名,便可以使用啦!
#include
#include
#include
#include
#include
#includeusing namespace std;
void Tiansing(){
const int qdo=262;
const int qre=294;
const int qmi=330; //q前缀为低音,1后缀为高音,s前缀为半音阶
const int qfa=349;
const int qso=392;
const int qla=440;
const int qsi=494;
const int d=523;
const int re=578;
const int mi=659;
const int fa=698;
const int so=784;
const int la=880;
const int si=988;
const int do1=1046;
const int re1=1175;
const int mi1=1318;
const int fa1=1480;
const int so1=1568;
const int la1=1760;
const int si1=1976;
const int sqdo=277;
const int sqre=311;
const int sqfa=370;
const int sqso=415;
const int sqla=466;
const int sdo=554;
const int sre=622;
const int sfa=740;
const int sso=831;
const int sla=932;
const int sdol=1046;
const int sre1=1245;
const int sfa1=1480;
const int sso1=1661;
const int sla1=1865;
int pai=400,ban=200;
int ting=128;Sleep(1000);
Beep(la,ban);
Beep(si,ban);
Sleep(ting);Beep(do1,pai+ban);
Beep(si,ban);
Sleep(ting);
Beep(do1,pai);
Sleep(ting);
Beep(mi1,pai);
Sleep(ting);Beep(si,3*pai);
Sleep(ting);
Beep(mi,ban);
Beep(mi,ban);Beep(la,ban+pai);
Beep(so,ban);
Sleep(ting);
Beep(la,pai);
Sleep(ting);
Beep(do1,pai);
Sleep(ting);Beep(so,2*pai);
Sleep(ting);
Sleep(pai);
Beep(mi,ban);
Sleep(ting/2);
Beep(mi,ban);
Sleep(ting/2);Beep(fa,pai+ban);
Beep(mi,ban);
Sleep(ting);
Beep(fa,ban);
Beep(do1,ban+pai);
Sleep(ting);Beep(mi,2*pai);
Sleep(ting);
Sleep(ban);
Beep(do1,ban);
Sleep(ting/2);
Beep(do1,ban);
Sleep(ting/2);
Beep(do1,ban);
Sleep(ting/2);Beep(si,ban+pai);
Beep(sfa,ban);
Sleep(ting);
Beep(sfa,pai);
Beep(si,pai);
Sleep(ting);Beep(si,2*pai);
Sleep(ting);
Sleep(pai);
Beep(la,ban);
Beep(si,ban);
Sleep(ting);Beep(do1,pai+ban);
Beep(si,ban);
Sleep(ting);
Beep(do1,pai);
Sleep(ting);
Beep(mi1,pai);
Sleep(ting);Beep(si,2*pai);
Sleep(ting);
Sleep(pai);
Beep(mi,ban);
Sleep(20);
Beep(mi,ban);
Sleep(ting);Beep(la,pai+ban);
Beep(so,ban);
Sleep(ting);
Beep(la,pai);
Sleep(ting);
Beep(do1,pai);
Sleep(ting);Beep(so,3*pai);
Sleep(ting+ban);
Beep(mi,ban);
Sleep(ting/2);Beep(fa,pai);
Sleep(ting);
Beep(do1,ban);
Beep(si,ban);
Sleep(20);
Beep(si,pai);
Sleep(ting);
Beep(do1,pai);
Sleep(ting);Beep(re1,ban);
Sleep(20);
Beep(re1,ban);
Sleep(20);
Beep(mi1,ban);
Sleep(ting/2);
Beep(do1,pai);
Sleep(ting+pai);Beep(do1,pai);
Beep(si,ban);
Sleep(ting);
Beep(la,ban);
Sleep(20);
Beep(la,ban);
Sleep(ting);
Beep(si,pai);
Sleep(ting);
Beep(sso,pai);
Sleep(ting);Beep(sso,2*pai);
Sleep(ting+pai);
Beep(do1,ban);
Beep(re1,ban);
Sleep(ting);Beep(mi1,pai+ban);
Beep(re1,ban);
Sleep(ting);
Beep(mi1,pai);
Sleep(ting);
Beep(fa1,pai);
Sleep(ting);Beep(re1,2*pai);
Sleep(pai+ting);
Beep(so,ban);
Sleep(20);
Beep(so,ban);
Sleep(ting);Beep(do1,ban);
Beep(si,ban);
Sleep(ting);
Beep(do1,pai);
Sleep(ting);
Beep(mi1,pai);
Sleep(ting);Beep(mi1,2*pai);
Sleep(ting+2*pai);Beep(la,ban);
Beep(si,ban);
Sleep(ting);
Beep(do1,pai);
Sleep(ting);
Beep(si,pai);
Sleep(ting);
Beep(re1,ban);
Sleep(20);
Beep(re1,ban);
Sleep(ting);Beep(do1,pai+ban);
Beep(so,ban);
Sleep(20);
Beep(so,pai);
Sleep(pai+ting);Beep(fa1,pai);
Sleep(ting);
Beep(mi1,pai);
Sleep(ting);
Beep(re1,pai);
Sleep(ting);
Beep(do1,pai);
Sleep(ting);Beep(mi1,4*pai);
Beep(mi1,pai*2);
Sleep(pai+ting);
Beep(mi1,pai);
Sleep(ting);Beep(la1,2*pai);
Sleep(ting);
Beep(so1,pai);
Sleep(ting);
Beep(so1,pai);
Sleep(ting);Beep(mi1,ban);
Sleep(ting/2);
Beep(re1,ban);
Sleep(ting);
Beep(do1,pai);
Sleep(ting+ban);
Beep(do1,ban);
Sleep(ting);Beep(re1,pai);
Sleep(ting);
Beep(do1,ban);
Beep(re1,ban);
Sleep(20);
Beep(re1,ban);
Sleep(ting);
Beep(so1,pai);
Sleep(ting);Beep(mi1,2*pai);
Sleep(ting+pai);
Beep(mi,pai);
Sleep(ting);Beep(la1,2*pai);
Sleep(ting);
Beep(so1,2*pai);
Sleep(ting);Beep(mi1,ban);
Beep(re1,ban);
Sleep(ting);
Beep(do1,2*pai);
Sleep(ting+ban);
Beep(do1,ban);
Sleep(ting);Beep(re1,pai);
Sleep(ting);
Beep(do1,ban);
Beep(re1,ban);
Sleep(20);
Beep(re1,ban);
Sleep(ting);
Beep(si,pai);
Sleep(ting);Beep(la,2*pai);
Sleep(ting);
Beep(la,ban);
Beep(si,ban);Beep(do1,pai+ban);
Beep(si,ban);
Sleep(ting);
Beep(do1,pai);
Sleep(ting);
Beep(mi1,pai);
Sleep(ting);Beep(si,3*pai);
Sleep(ting);
Beep(mi,ban);
Beep(mi,ban);Beep(la,ban+pai);
Beep(so,ban);
Sleep(ting);
Beep(la,pai);
Sleep(ting);
Beep(do1,pai);
Sleep(ting);Beep(so,2*pai);
Sleep(ting);
Sleep(pai);
Beep(mi,ban);
Sleep(ting/2);
Beep(mi,ban);
Sleep(ting/2);Beep(fa,pai+ban);
Beep(mi,ban);
Sleep(ting);
Beep(fa,ban);
Beep(do1,ban+pai);
Sleep(ting);Beep(mi,2*pai);
Sleep(ting);
Sleep(ban);
Beep(do1,ban);
Sleep(ting/2);
Beep(do1,ban);
Sleep(ting/2);
Beep(do1,ban);
Sleep(ting/2);Beep(si,ban+pai);
Beep(sfa,ban);
Sleep(ting);
Beep(sfa,pai);
Beep(si,pai);
Sleep(ting);Beep(si,2*pai);
Sleep(ting);
Sleep(pai);
Beep(la,ban);
Beep(si,ban);
Sleep(ting);Beep(do1,pai+ban);
Beep(si,ban);
Sleep(ting);
Beep(do1,pai);
Sleep(ting);
Beep(mi1,pai);
Sleep(ting);Beep(si,2*pai);
Sleep(ting);
Sleep(pai);
Beep(mi,ban);
Sleep(20);
Beep(mi,ban);
Sleep(ting);Beep(la,pai+ban);
Beep(so,ban);
Sleep(ting);
Beep(la,pai);
Sleep(ting);
Beep(do1,pai);
Sleep(ting);Beep(so,3*pai);
Sleep(ting+ban);
Beep(mi,ban);
Sleep(ting/2);Beep(fa,pai);
Sleep(ting);
Beep(do1,ban);
Beep(si,ban);
Sleep(20);
Beep(si,pai);
Sleep(ting);
Beep(do1,pai);
Sleep(ting);Beep(re1,ban);
Sleep(20);
Beep(re1,ban);
Sleep(20);
Beep(mi1,ban);
Sleep(ting/2);
Beep(do1,pai);
Sleep(ting+pai);Beep(la,4*pai);
Sleep(1000);
}
#define N 10
#define Time 202004270
#define I 20
#define R 340
#define MAX 99999999int sign = 0;
char data[16][100]={
{"\n ☆今晚最美丽的朝鲜。☆\n"},
{"\n ☆祝你生日快乐!祝你生日快乐!☆\n"},
{"\n ☆Happy birthday to you!☆\n"},
{"\n ☆Happy birthday my dear friend!☆\n"},
{"\n ☆在你面前的台里本,总有一天是很独特!☆\n"},
{"\n ☆虽然你和我,没办法选,来到世界的某刻。☆\n"},
{"\n ☆天气寒冷,又或炎热,又或者什么血型和星座!☆\n"},
{"\n ☆每年这刻,我会对你说,有生的日子要更快乐!☆\n"},
{"\n ☆又到这一个时刻,幸福的花火,手机祝福收到很多很多。☆\n"},
{"\n ☆亲爱的朋友要经常联络,我们一起来唱这首歌!☆\n"},
{"\n ☆祝你生日快乐额!我们一起快乐!☆\n"},
{"\n ☆最后的最后☆\n"},
{"\n ☆愿你的生日伴随着幸福与喜悦,从日出到日落!☆\n"},
{"\n\n\n"},
{"\n ☆致我的好朋友:叶朝鲜☆\n"},
{"\n ☆2020/12/28 江子良制作☆"}
};int i,j,e;
int a;
long time;
char randk();#include
void BrithdaySecond();
void BrithdaySecond()
{
unsigned frequency[] = { 394, 392, 440, 392, 523, 494,
392, 392, 440, 392, 587, 523,
392, 392, 784, 659, 523, 494, 440,
698, 698, 659, 523, 587, 523 };
unsigned delay[] = { 800, 800, 800, 800, 800, 1000,
875, 825, 800, 800, 800, 1000,
875, 825, 800, 800, 800, 800, 1000,
875, 825, 800, 800, 800, 1000, };for (int i = 0; i<25; i++)
{Beep(frequency[i], delay[i]);
}
}
//________________________________________________________________________________________________________________
//定义低音
const int A1 = 131;
const int A2 = 147;
const int A3 = 165;
const int A4 = 175;
const int A5 = 196;
const int A6 = 220;
const int A7 = 247;//定义中音
const int B1 = 262;
const int B2 = 296;
const int B3 = 330;
const int B4 = 349;
const int B5 = 392;
const int B6 = 440;
const int B7 = 494;//定义高音
const int C1 = 523;
const int C2 = 587;
const int C3 = 659;
const int C4 = 698;
const int C5 = 784;
const int C6 = 880;
const int C7 = 988;//定义高二度
const int D1 = 1047;
const int D2 = 1175;
const int D3 = 1319;
const int D4 = 1397;
const int D5 = 1568;
const int D6 = 1760;
const int D7 = 1976;//定义节拍
const int OneBeat = 650;
const int HalfBeat = 325;//___________________________________________________________
float ff(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 hh(float x, float z)
{
for (float y = 1.0f; y >= 0.0f ; y -= 0.001f)
if (ff(x, y, z) <= 0.0f)
return y;
return 0.0f;
}
//___________________________________________________________
void PrintfHeart()
{
printf(" ");
for(float z = 1.5f; z > -1.2f; z -= 0.05f)
{
for(float x = -1.5f; x < 1.2f; x += 0.025f)
{
float v = ff(x, 0.0f, z);
if (v <= 0.0f)
{
//s[7]=randk();
//system(s);
float y0 = hh(x, z);
float ny = 0.01f;
float nx = hh(x + ny, z) - y0;
float nz = hh(x, z + ny) - y0;
float nd = 1.0f / sqrtf(nx * nx + ny * ny + nz * nz);
float d = (nx + ny - nz) * nd * 0.5f + 0.5f;
putchar(".:-=+*#%@"[(int)(d * 5.0f)]);
}
else
putchar(' ');
}
putchar('\n');
printf(" ");}
}
void PrintHeart(){
printf(" ");
for(i=1,a=I;i {
for(j=(int) ( I-sqrt(I*I-(a-i)*(a-i)) );j>0;j--)
printf(" ");
for(e=1;e<=2*sqrt(I*I-(a-i)*(a-i));e++)
printf("\3");
for(j=(int)
( 2*( I-sqrt(I*I-(a-i)*(a-i)) ) );j>0;j--)
printf(" ");
for(e=1;e<=2*sqrt(I*I-(a-i)*(a-i));e++)
printf("\3");
printf("\n");
printf(" ");
}for(i=1;i<80;i++)
{
if(i==25)
{
printf("======祝叶朝鲜,生日快乐!======");
i+=30;
}
printf("\3");
}
printf("\n");
printf(" ");
for(i=1;i<=R/2;i++)
{
if(i%2||i%3)
continue;
for(j=(int) ( R-sqrt(R*R-i*i) );j>0;j--)
printf(" ");
for(e=1;e<=2*( sqrt(R*R-i*i) - (R-2*I) );e++)
printf("\3");
printf("\n");
printf(" ");
}
}
//____________________________________________________________________
void cake()
{
cout<printf(" ★!生日快乐!★\n");
printf(" ! ! !\n");
printf(" ---------\n");
printf(" |★朝 鲜 ★|\n");
printf(" -------------\n");
printf(" | 生 日 快 乐 |\n");
printf(" -----------------\n");
printf(" | 2020 |\n");
printf(" |★ ★ ★ ★ ★ ★ ★|\n");;
}//____________________________________________________________________
void BrithdayFirst(){Beep(C5, HalfBeat);
Beep(C5, HalfBeat);
Beep(C6, OneBeat);
Beep(C5, OneBeat);
Beep(D1, OneBeat);
Beep(C7, OneBeat * 2);Beep(C5, HalfBeat);
Beep(C5, HalfBeat);
Beep(C6, OneBeat);
Beep(C5, OneBeat);
Beep(D2, OneBeat);
Beep(D1, OneBeat * 2);Beep(C5, HalfBeat);
Beep(C5, HalfBeat);
Beep(D5, OneBeat);
Beep(D3, OneBeat);
Beep(D1, OneBeat);
Beep(C7, OneBeat);Beep(D4, HalfBeat);
Beep(D4, HalfBeat);
Beep(D3, OneBeat);
Beep(D1, OneBeat);
Beep(D2, OneBeat);
Beep(D1, OneBeat * 2);
Beep(C5, HalfBeat);
Beep(C5, HalfBeat);
Beep(D5, OneBeat);
Beep(D3, OneBeat);
Beep(D1, OneBeat);
Beep(C7, HalfBeat);
Beep(C6, OneBeat * 2);Beep(D4, HalfBeat);
Beep(D4, HalfBeat);
Beep(D3, OneBeat);
Beep(D1, OneBeat);
Beep(D2, OneBeat);
Beep(D1, OneBeat * 3);Sleep(500);
}
//-----------------------------------------------------void man(){
int a[15][37]={0};
int i,j;
a[0][18]=1;
for(j=17;j<20;j++) a[1][j]=1;
for(j=16;j<21;j++) a[2][j]=1;
for(j=15;j<22;j++) a[3][j]=1;
for(j=14;j<23;j++) a[4][j]=1;
for(j=1;j<36;j++) a[5][j]=1;
for(j=4;j<33;j++) a[6][j]=1;
for(j=7;j<30;j++) a[7][j]=1;
for(j=10;j<27;j++) a[8][j]=1;
for(j=12;j<25;j++) a[9][j]=1;
for(j=11;j<26;j++) a[10][j]=1;
for(j=10;j<18;j++) a[11][j]=1;
for(j=19;j<27;j++) a[11][j]=1;
for(j=9;j<15;j++) a[12][j]=1;
for(j=22;j<28;j++) a[12][j]=1;
for(j=8;j<12;j++) a[13][j]=1;
for(j=25;j<29;j++) a[13][j]=1;
for(j=7;j<9;j++) a[14][j]=1;
for(j=28;j<30;j++) a[14][j]=1;
a[15][6]=1,a[15][31]=1;
for(i=0;i<15;i++)
{
for(j=0;j<37;j++)
if(a[i][j]==1)
printf("*");
else printf(" ");
printf("\n");
}
}
//______________________________________________________
char s[10]="color ";
int main()
{
system("pause");
int oo=1;
while(oo--)
{
system("color 0a");
for(time=0;time<99999999/2;time++); system("color 0f");
for(time=0;time<99999999/2;time++); system("color 0c");
for(time=0;time<99999999/2;time++); system("color 0d");
for(time=0;time<99999999/2;time++); system("color 0e");
for(time=0;time<99999999/2;time++); system("color 0b");
for(time=0;time<99999999/2;time++);
system("color 00"); for(time=0;time<99999999/2;time++);
system("color 01"); for(time=0;time<99999999/2;time++);
system("color 02"); for(time=0;time<99999999/2;time++);
system("color 03"); for(time=0;time<99999999/2;time++);
system("color 04");
for(time=0;time<99999999/2;time++); system("color 05");
for(time=0;time<99999999/2;time++); system("color 06");
for(time=0;time<99999999/2;time++); system("color 07");
for(time=0;time<99999999/2;time++); system("color 08");
for(time=0;time<99999999/2;time++); system("color 09");
for(time=0;time<99999999/2;time++);man();
puts("\n\n\n\n\n\n\n \a");
printf("\a ☆此代码致叶朝鲜☆\n\n");
printf("\a ☆希望她生日和我敲代码时一样开心☆\n");
puts("\a\n\n\n\n\n\n\n ");
man();
}
system("pause");
system("cls");PrintHeart();
for(i=0; i{
s[6]=randk();
s[7]=randk();
system(s);
}
cake();
printf("\n");
printf("☆按下任意键,看看会发生什么?嘿嘿嘿(●ˇ?ˇ●)☆\n\a");
system("pause");
BrithdayFirst();
cout<<"\n☆按下任意键进入下一个界面,还没结束呢,嘿嘿。☆\n\a"<system("pause");
system("cls");int o=3;
while(o>=1)
{
system("color fa");
for(time=0;time<99999999/2;time++); system("color ff");
for(time=0;time<99999999/2;time++); system("color fc");
for(time=0;time<99999999/2;time++); system("color fd");
for(time=0;time<99999999/2;time++); system("color fe");
for(time=0;time<99999999/2;time++); system("color fb");
for(time=0;time<99999999/2;time++);
system("color f0"); for(time=0;time<99999999/2;time++);
system("color f1"); for(time=0;time<99999999/2;time++);
system("color f2"); for(time=0;time<99999999/2;time++);
system("color f3"); for(time=0;time<99999999/2;time++);
system("color f4");
for(time=0;time<99999999/2;time++); system("color f5");
for(time=0;time<99999999/2;time++); system("color f6");
for(time=0;time<99999999/2;time++); system("color f7");
for(time=0;time<99999999/2;time++); system("color f8");
for(time=0;time<99999999/2;time++); system("color f9");
for(time=0;time<99999999/2;time++);
cout<o--;
}
system("color fa");
for(time=0;time<99999999;time++); system("color ff");
for(time=0;time<99999999;time++); system("color fc");
for(time=0;time<99999999;time++); system("color fd");
for(time=0;time<99999999;time++); system("color fe");
for(time=0;time<99999999;time++); system("color fb");
for(time=0;time<99999999;time++);
system("color f0"); for(time=0;time<99999999;time++);
system("color f1"); for(time=0;time<99999999;time++);
system("color f2"); for(time=0;time<99999999;time++);
system("color f3"); for(time=0;time<99999999;time++);
system("color f4");
for(time=0;time<99999999;time++); system("color f5");
for(time=0;time<99999999;time++); system("color f6");
for(time=0;time<99999999;time++); system("color f7");
for(time=0;time<99999999;time++); system("color f8");
for(time=0;time<99999999;time++); system("color f9");
for(time=0;time<99999999;time++);
printf("\n\n☆为朝鲜的生辰献上来自天空的赞歌!☆\a");
PrintfHeart();
Tiansing();
int cs=0;
while(1)
{system("color ca");
for(time=0;time<99999999;time++); system("color cf");
for(time=0;time<99999999;time++); system("color cc");
for(time=0;time<99999999;time++); system("color cd");
for(time=0;time<99999999;time++); system("color ce");
for(time=0;time<99999999;time++); system("color cb");
for(time=0;time<99999999;time++);
system("color c0"); for(time=0;time<99999999;time++);
system("color c1"); for(time=0;time<99999999;time++);
system("color c2"); for(time=0;time<99999999;time++);
system("color c3"); for(time=0;time<99999999;time++);
system("color c4");
for(time=0;time<99999999;time++); system("color c5");
for(time=0;time<99999999;time++); system("color c6");
for(time=0;time<99999999;time++); system("color c7");
for(time=0;time<99999999;time++); system("color c8");
for(time=0;time<99999999;time++); system("color c9");
for(time=0;time<99999999;time++);
printf("%s\a",data[sign]);
sign++;
if(cs==17) printf("\n\n\n\n\n\n\n\n\n☆代码至此,生命已经走到了尽头,它能为你做的:☆\a\n");
if(cs==18) printf("\n☆只有献上最后一首生日快乐歌!☆\a\n\n");
if(cs==20){
system("pause");
PrintHeart();
BrithdaySecond();
break;
}
cs++;
}
system("PAUSE");char dataa[15][100]={
{"\n\a ☆想欣赏天空的美,看朝霞就知道。☆\n"},
{"\n\a ☆想欣赏鲜花的美,看玫瑰就知道。☆\n"},
{"\n\a ☆想欣赏人的美,看你就知道。☆\n"},
{"\n\a ☆我给你的生日代码到了尾声!☆\n"},
{"\n\a ☆在这最美的一天向美丽的你献上最美的祝福:☆\n"},
{"\n\a ☆愿你幸福日日相伴!☆\n"},
{"\n\a ☆快乐岁岁年年!☆\n"},
{"\n\a ☆美丽直到永远!☆\n"}
};
man();
cout<for(int i=0;i<8;i++)
printf("%s",dataa[i]);
man();
return 0;
}
//______________________________________________
char randk()
{
char a=0;
a=(char) abs( rand()%16);
if(a >=10)
{
a-=10;
a+=97;
}
else a+=48;return a;
}