#include <iostream>
int main() {
std::cout << "********** 月亮 **********" << std::endl;
std::cout << " ***** *****" << std::endl;
std::cout << " * 月饼 *" << std::endl;
std::cout << " ***** *****" << std::endl;
std::cout << "********** 月亮 **********" << std::endl;
std::cout << "祝大家中秋节快乐!" << std::endl;
return 0;
}
#include <iostream>
#include <ctime>
#include <cstdlib>
int main() {
srand(time(nullptr));
std::cout << "欢迎来参加中秋节的月饼抛掷游戏!" << std::endl;
std::cout << "看看你的运气能不能抛中奖品吧!" << std::endl;
int throwResult = rand() % 3; // 随机生成0、1、2,代表月饼的不同结果
switch (throwResult) {
case 0:
std::cout << "恭喜你,抛中了一个大奖月饼!" << std::endl;
break;
case 1:
std::cout << "不错,你抛中了一个普通月饼。" << std::endl;
break;
case 2:
std::cout << "很遗憾,你没有抛中奖品。" << std::endl;
break;
}
std::cout << "祝您中秋节快乐!" << std::endl;
return 0;
}