写一个根据运气 体质 颜值 家境 智能各种数值综合并能成长的数据 随机从列表取事件的代码 用c++
时间: 2024-06-05 11:06:37 浏览: 12
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main() {
int luck, physique, appearance, family, intelligence;
int event_num;
char *event_list[] = {
"恭喜你获得了一次出国旅游的机会!",
"你的运气真是太差了,被偷了钱包。",
"因为你的颜值和智能,成功约到了心仪已久的对象。",
"家里出现了意外开支,你需要为家庭负责。",
"由于你的体质过于虚弱,需要加强锻炼。",
"你成功通过了一项重要的考试,获得了晋升的机会。",
"今天你的运气非常好,中了彩票一等奖!",
"你的智能让你成为同事们的重要合作伙伴。",
"家里买了一只可爱的宠物狗,需要花费时间和精力照顾它。",
"你的颜值让你成为了公司的代表人物,需要参加重要活动。"
};
srand(time(NULL));
printf("请输入你的运气(1-10):");
scanf("%d", &luck);
printf("请输入你的体质(1-10):");
scanf("%d", &physique);
printf("请输入你的颜值(1-10):");
scanf("%d", &appearance);
printf("请输入你的家境(1-10):");
scanf("%d", &family);
printf("请输入你的智能(1-10):");
scanf("%d", &intelligence);
event_num = rand() % 10;
if (luck >= 5 && physique >= 5 && appearance >= 5 && family >= 5 && intelligence >= 5) {
printf("恭喜你成为了一个全才!\n");
}
printf("今天发生的事件是:\n%s\n", event_list[event_num]);
return 0;
}
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)