用c++表达对母亲节的祝福

1.前言

今天是母亲节,祝全天下的母亲节日快乐,除此之外,我还带来了c++的代码,用c++代码送来额外的祝福。

2.源码

这段代码支持中英双语祝福,

以下是作者写的c++代码

#include <bits/stdc++.h>
#include <windows.h>
using namespace std;

void drawheart() {
	cout << "  *****     *****\n";
	std::this_thread::sleep_for(std::chrono::milliseconds(300));
	cout << " *******   *******\n";
	std::this_thread::sleep_for(std::chrono::milliseconds(300));
	cout << "********* *********\n";
	std::this_thread::sleep_for(std::chrono::milliseconds(300));
	cout << "*******************\n";
	std::this_thread::sleep_for(std::chrono::milliseconds(300));
	cout << " *****************\n";
	std::this_thread::sleep_for(std::chrono::milliseconds(300));
	cout << "  *************** \n";
	std::this_thread::sleep_for(std::chrono::milliseconds(300));
	cout << "   *************  \n";
	std::this_thread::sleep_for(std::chrono::milliseconds(300));
	cout << "    ***********   \n";
	std::this_thread::sleep_for(std::chrono::milliseconds(300));
	cout << "     *********    \n";
	std::this_thread::sleep_for(std::chrono::milliseconds(300));
	cout << "      *******     \n";
	std::this_thread::sleep_for(std::chrono::milliseconds(300));
	cout << "       *****      \n";
	std::this_thread::sleep_for(std::chrono::milliseconds(300));
	cout << "        ***       \n";
	std::this_thread::sleep_for(std::chrono::milliseconds(300));
	cout << "         *        \n";
	std::this_thread::sleep_for(std::chrono::milliseconds(700));
}

bool lan(int l) { //0为中文,1为英文。
	if (l == 1) {
		return 0;
	}
	if (l == 2) {
		return 1;
	}
}

void cn() {
	cout << "今天是母亲节" << endl;
	std::this_thread::sleep_for(std::chrono::milliseconds(900));
	cout << "祝天下所有母亲母亲节快乐" << endl;
	std::this_thread::sleep_for(std::chrono::milliseconds(900));
	cout << "愿天堂的母亲无忧无愁" << endl;
	std::this_thread::sleep_for(std::chrono::milliseconds(900));
	cout<<"6秒后有惊喜"<<endl;
	std::this_thread::sleep_for(std::chrono::milliseconds(6000));
	drawheart();
	cout<<"我爱你,母亲";
}

void eng() 
{
	cout << "Today is Mother's Day" << endl;
		std::this_thread::sleep_for(std::chrono::milliseconds(900));
		cout << "Wishing all mothers in the world a happy Mother's Day" << endl;
		std::this_thread::sleep_for(std::chrono::milliseconds(900));
		cout << "May the mother of heaven be carefree and carefree" << endl;
		std::this_thread::sleep_for(std::chrono::milliseconds(900));
		cout<<"Surprise in 6 seconds"<<endl;
		std::this_thread::sleep_for(std::chrono::milliseconds(6000));
		drawheart();
		cout<<"I love you, mother";
}
int main() {
	cout << "请选择语言(填数字):" << endl;
	cout << "Please select language (fill in numbers):" << endl;
	int l;
	cout << "[1]中文" << endl;
	cout << "[2]English" << endl;
	cin >> l;
	HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(hConsole, FOREGROUND_RED);
	if (lan(l)) {
		eng();
	} else {
		cn();
	}
	SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
	return 0;
}

3.相关软件

为了运行上面的代码,这里我推荐dev-cpp:

​123云盘下载地址,提取码:pacn

阿里云盘下载地址,提取码:20gu

4.后记

这段代码是给天下所有母亲写的,希望我这个代码会给更多的母亲看到。

作者向所有伟大的母亲致敬,有了您,才有了我们。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值