求赐教,用C++制作一个制作一个祝朋友生日快乐的程序!

求赐教,用C++制作一个制作一个祝朋友生日快乐的程序!,第1张

#include <iostream>

#include <stdlibh>

#include <conioh>

#include <stdioh>

#include <stdlibh>

#include <timeh>

#include <windowsh>

using namespace std;

void color(int a)//颜色函数

{

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),a);

}

int main(){

char a;

color(12);

cout << "Do you want to see your BIRTHDAY CARD( Input y or n )" << endl;

color(15);

cin >> a;

color(12);

if ( a=='y' ){

cout << "Ok, you will see your birthday card soon!" << endl;

} else {

cout << "That's OK, but happy birthday to you!" << endl;

return 0;

}

Sleep(1000);

color(268);

cout << "HAPPY ";

color(270);

cout << "BRITHDAY ";

color(9);

cout << "TO ";

color(10);

cout << "YOU!" << endl;

color(0);

Sleep(500);

cout << " ";

color(236);

cout << "";

color(0);

cout << " ";

color(236);

cout << "" << endl;

Sleep(500);

color(0);

cout << " ";

color(236);

cout << "";

color(0);

cout << " ";

color(236);

cout << "" << endl;

Sleep(500);

cout << "" << endl;

Sleep(500);

cout << "" << endl;

Sleep(500);

cout << "" << endl;

Sleep(500);

color(0);

cout << " ";

color(236);

cout << "" << endl;

Sleep(500);

color(0);

cout << " ";

color(236);

cout << "" << endl;

Sleep(500);

color(0);

cout << " ";

color(236);

cout << "" << endl;

Sleep(500);

color(0);

cout << " ";

color(236);

cout << "" << endl;

Sleep(500);

color(0);

cout << " ";

color(236);

cout << "" << endl;

Sleep(500);

color(0);

cout << " ";

color(236);

cout << "" << endl;

Sleep(500);

char c[55] = { 'T' ,'h' ,'a' ,'n' ,'k', ' ' ,'y' ,'o' ,'u', ' ' ,'f' ,'o' ,'r', ' ' ,'l' ,'o' ,'o' ,'k' ,'i' ,'n' ,'g', ' ' ,'a' ,'f' ,'t' ,'e' ,'r', 's', ' ' ,'m' ,'e', ' ' ,'f' ,'o' ,'r', ' ' ,'e' ,'l' ,'e' ,'v' ,'e' ,'n', ' ' ,'y' ,'e' ,'a' ,'r' ,'s', ',', ' ' ,'m' ,'o' ,'m' ,'!', '0' };

for ( int i=0; i<=53; i++ ){

color( ( i+1 ) % 15 + 1 );

cout << c[i];

}

cout << endl;

Sleep(10000);

char d[12] = { 'I', ' ', 'l', 'o', 'v', 'e', ' ', 'y', 'o', 'u', '!', '0' };

int count = 0;

for ( int j=1; j<=1000; j++ ){

count++;

for ( int i=0; i<=10; i++ ){

color(i+1);

cout << d[i];

}

cout << " ";

}

cout << endl;

cout << "What present do you want(Input the number of the present)" << endl;

char e;

cout << "A clothes(A); (B); Lipstick(C)" << endl;

cin >> e;

srand((unsigned)time(NULL));

for ( int i=1; i<=20; i++ ){

system( "cls" );

int s = 1;

int tmp = rand()%4;

switch( tmp ){

case 0:{

tmp++;

break;

}

case 1:{

color(rand()%15+1);

s++;

cout << " # " << endl;

color(rand()%15+1);

s++;

cout << " # # " << endl;

color(rand()%15+1);

s++;

cout << " # # " << endl;

color(rand()%15+1);

s++;

cout << " ####### " << endl;

color(rand()%15+1);

s++;

cout << " # # " << endl;

color(rand()%15+1);

s++;

cout << " # # " << endl;

color(rand()%15+1);

s++;

cout << " # # " << endl;

break;

}

case 2:{

color(rand()%15+1);

s++;

cout << " ######### " << endl;

color(rand()%15+1);

s++;

cout << " # # " << endl;

color(rand()%15+1);

s++;

cout << " # # " << endl;

color(rand()%15+1);

s++;

cout << " ######### " << endl;

color(rand()%15+1);

s++;

cout << " # # " << endl;

color(rand()%15+1);

s++;

cout << " # # " << endl;

color(rand()%15+1);

s++;

cout << " ######### " << endl;

break;

}

case 3:{

color(rand()%15+1);

s++;

cout << " ######### " << endl;

color(rand()%15+1);

s++;

cout << " # " << endl;

color(rand()%15+1);

s++;

cout << " # " << endl;

color(rand()%15+1);

s++;

cout << " # " << endl;

color(rand()%15+1);

s++;

cout << " # " << endl;

color(rand()%15+1);

s++;

cout << " # " << endl;

color(rand()%15+1);

s++;

cout << " ######## " << endl;

break;

}

}

Sleep(i50);

}

system ( "cls" );

switch( e ){

case 'A':{

color(rand()%15+1);

cout << " # " << endl;

color(rand()%15+1);

cout << " # # " << endl;

color(rand()%15+1);

cout << " # # " << endl;

color(rand()%15+1);

cout << " ####### " << endl;

color(rand()%15+1);

cout << " # # " << endl;

color(rand()%15+1);

cout << " # # " << endl;

color(rand()%15+1);

cout << " # # " << endl;

break;

}

case 'B':{

color(rand()%15+1);

cout << " ######### " << endl;

color(rand()%15+1);

cout << " # # " << endl;

color(rand()%15+1);

cout << " # # " << endl;

color(rand()%15+1);

cout << " ######### " << endl;

color(rand()%15+1);

cout << " # # " << endl;

color(rand()%15+1);

cout << " # # " << endl;

color(rand()%15+1);

cout << " ######### " << endl;

break;

}

case 'c':{

color(rand()%15+1);

cout << " ######### " << endl;

color(rand()%15+1);

cout << " # " << endl;

color(rand()%15+1);

cout << " # " << endl;

color(rand()%15+1);

cout << " # " << endl;

color(rand()%15+1);

cout << " # " << endl;

color(rand()%15+1);

cout << " # " << endl;

color(rand()%15+1);

cout << " ######## " << endl;

break;

}

}

color(rand()%15+1);

cout << "You are very LUKY!" << endl;

cout << "Please turn your head!" << endl;

cout << "Tab return to continue";

cout << endl;

color(0);

system( "pause" );

color(rand()%1023+1);

cout << "Are you happy!" << endl;

color(rand()%1023+1);

cout << "I think you are!!!" << endl;

color(rand()%1023+1);

cout << "--------!";

Sleep ( 3000 );

cout << endl;

color(15);

cout << "######" << endl;

cout << " #" << endl;

cout << "######" << endl;

cout << " #" << endl;

cout << "######" << endl;

Sleep( 2000 );

system( "cls" );

cout << " @@@@ " << endl;

cout << "@ @" << endl;

cout << " @ " << endl;

cout << " @ " << endl;

cout << "@@@@@@" << endl;

Sleep ( 2000 );

system( "cls" );

cout << " !! " << endl;

cout << " !!! " << endl;

cout << " !! " << endl;

cout << " !! " << endl;

cout << "!!!!!!" << endl;

Sleep ( 2000 );

system( "cls" );

color( rand()%1023+1 );

cout << " ###### # # ###### # " << endl;

cout << " # # # # # # " << endl;

cout << " # # # # # # " << endl;

cout << " ###### # ###### # " << endl;

cout << " # # # # # " << endl;

cout << " # # # # " << endl;

cout << " ###### # ###### # " << endl;

color(15);

return 0;

}

仅供参考!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

#include"stdio.h"

#include <stringh>

intmain(void){

chara[]="Iwishyouahappybirthday!baiIwishyouahappybirthday!",m[4],i;

printf("\n\n\n");

printf("%*.*s\n",58,21,"_*=__=*_");

printf("%*.*s\n",61,25,"Wishyourbirthday!");

printf("%*.*s\n",63,29,"Iwishyouahappybirthday!");

printf("%*.*s\n",65,33,a);

printf("%*.*s\n",66,35,a);

printf("%*.*s\n",66,35,a);

printf("%*.*s\n",65,33,a);

printf("%*.*s\n",64,31,a);

printf("%*.*s\n",63,29,a);

printf("%*.*s\n",61,25,a);

printf("%*.*s\n",59,21,a);

printf("%*.*s\n",57,17,a);

printf("%*.*s\n",55,13,a);

printf("%*.*s\n",53,9,a);

printf("%*.*s\n",51,5,a);

printf("%*.*s\n",50,3,a);

printf("%*.*s\n",49,1,a);

return0;

扩展资料

或者:

#include <stdioh>

#include <mathh>

#include <stdlibh>

#defineI20

#defineR340

intmain()

system("modeconcols=80lines=60");

system("title向你致以最诚挚的祝福!");

chardata[200][60]={{"祝你生日快乐!祝你生日快乐!"},{"\nHappybirthdaytoyou!\n"},{"Happybirthdaymydearfriend!\n"},

{"在你面前的台里本,总有一天是很独特!\n"},{"虽然你和我,没办法选,来到世界的某刻。\n"},{"天气寒冷,又或炎热,又或者什么血型和星座!\n"},

{"每年这刻,我对自己说,有生的日子要更快乐!\n"},{"天气寒冷,又或炎热,又或者什么血型和星座!\n"},{"每年这刻,我对自己说,有生的日子要更快乐!\n"},

{"爸爸妈妈辛苦了!谢谢你们为我付出太多!\n"},{"生日祝福,吹灭蜡烛,我要我自己不许哭。\n"},{"长大了一岁变得靠谱,继续走自己的旅程!\n"},

{"又到这一个时刻,幸福的花火,手机祝福收到很多很多。\n"},{"看到最后一条来自你,写着让我感动的话语。\n"},{"亲爱的朋友要经常联络,我们一起来唱这首歌!\n"},

{"祝你生日快乐额!我们一起快乐!\n"}

};

intsign=0;

inti,j,e;

inta;

longtime;

  for(i=1,a=I;i<I/2;i++,a--)

      for(j=(int) ( I-sqrt(II-(a-i)(a-i)) );j>0;j--)

printf("");

      for(e=1;e<=2sqrt(II-(a-i)(a-i));e++)

printf("\3");

for(j=(int)

          ( 2( I-sqrt(II-(a-i)(a-i)) ) );j>0;j--)

printf("");

      for(e=1;e<=2sqrt(II-(a-i)(a-i));e++)

printf("\3");

printf("\n");

  for(i=1;i<80;i++)

if(i==25)

printf("======祝,生日快乐。======");

i+=30;

printf("\3");

printf("\n");

      for(i=1;i<=R/2;i++)

if(i%2||i%3)

continue;

      for(j=(int) ( R-sqrt(RR-ii) );j>0;j--)

printf("");

      for(e=1;e<=2( sqrt(RR-ii) - (R-2I) );e++)

printf("\3");

printf("\n");

for(;;)

system("colora");

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("color4");

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");

for(time=0;time<99999999;time++); system("color ab");

for(time=0;time<99999999;time++); system("color ac");

for(time=0;time<99999999;time++); system("color ad");

for(time=0;time<99999999;time++); system("color ae");

for(time=0;time<99999999;time++); system("color af");

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

printf("%s",data[sign]);

sign++;

return0;

以上就是关于求赐教,用C++制作一个制作一个祝朋友生日快乐的程序!全部的内容,包括:求赐教,用C++制作一个制作一个祝朋友生日快乐的程序!、有一个圣诞快乐的程序据说是用C语言写的,我想把它改成生日快乐的,跪求原代码~谢谢各位、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/9848092.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-02
下一篇 2023-05-02

发表评论

登录后才能评论

评论列表(0条)

保存