求赐教,用C++制作一个制作一个祝朋友生日快乐的程序!
发布网友
发布时间:2022-05-07 12:27
我来回答
共2个回答
热心网友
时间:2023-10-30 19:25
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
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(i*50);
}
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;
}
仅供参考!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
热心网友
时间:2023-10-30 19:25
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
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(i*50);
}
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;
}
仅供参考!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
热心网友
时间:2023-10-30 19:25
MFC是你的好朋友~
热心网友
时间:2023-10-30 19:25
MFC是你的好朋友~
热心网友
时间:2023-10-30 19:25
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
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(i*50);
}
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;
}
仅供参考!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
热心网友
时间:2023-10-30 19:25
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
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(i*50);
}
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;
}
仅供参考!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
热心网友
时间:2023-10-30 19:25
MFC是你的好朋友~
热心网友
时间:2023-10-30 19:25
MFC是你的好朋友~
热心网友
时间:2023-10-30 19:25
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
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(i*50);
}
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;
}
仅供参考!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
热心网友
时间:2023-10-30 19:25
MFC是你的好朋友~
热心网友
时间:2023-10-30 19:25
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
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(i*50);
}
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;
}
仅供参考!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
热心网友
时间:2023-10-30 19:26
MFC是你的好朋友~
热心网友
时间:2023-10-30 19:25
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
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(i*50);
}
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;
}
仅供参考!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
热心网友
时间:2023-10-30 19:25
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
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(i*50);
}
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;
}
仅供参考!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
热心网友
时间:2023-10-30 19:26
MFC是你的好朋友~
热心网友
时间:2023-10-30 19:25
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
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(i*50);
}
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;
}
仅供参考!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
热心网友
时间:2023-10-30 19:26
MFC是你的好朋友~
热心网友
时间:2023-10-30 19:26
MFC是你的好朋友~