关于#c++#的问题:一直到一百岁的循环中间的年龄需要加特殊事件加一些事件的选择去影响颜值属性的变化

用c语言编写人生重开模拟器的年龄循环
用for的循环嵌套!
比如
你一岁了
你两岁了。
一直到一百岁的循环,中间的年龄需要加特殊事件!eg 你六岁了需要上小学了
加一些事件的选择给玩家一些选择去影响颜值或一些属性的变化
如果可以的话我希望这个东西在运行的时候一句话一句话弹出来

for循环嵌套是为了多次从1岁开始循环吗?
你完全可以在特定的年龄加输入,根据输入来改变一些数值就可以了。
上次给你写的那个不行吗?
写了一个例子,供参考:

#include <stdio.h>
int main() {
    int op;
    int tizhi = 0, jiajing = 0, zizu = 0;  //体制、家境、自力更生能力
    int t;
    int i, j;
    for (i=0;i<10;i++) //重复10次
    {
        printf("请选择性别:\n");
        printf("3.女孩\n");
        printf("4.男孩\n");
        int gender;
        scanf_s("%d", &gender);
        if (gender == 3)
        {
            printf("你是一个女孩\n");

            for (j = 1; j <= 100; j++)
            {
                printf("你现在%d岁了。", j);
                if(j==1)
                    printf(",你的颜值:可爱。");
                else if (j == 6)
                {
                    printf("你现在要上小学了,");
                    printf("你的体制增强了,新的体质值为:");
                    scanf_s("%d", &tizhi);

                }
                else if (j == 10)
                {
                    printf("你的家境发生了变化,家境变为:");
                    scanf_s("%d", &jiajing);
                }
                else if (j == 18)
                {
                    printf("你的颜值:貌美如花。");
                    printf("是否进行美容手术(1.是  2.否):");
                    scanf_s("%d",&t);
                    if(t==1)
                        printf("你的颜值提升了!\n");
                    
                    printf("你现在上大学了,你具备了自力更生的能力,能力值为:");
                    scanf_s("%d", &zizu);
                }
                else if (j == 22)
                {
                    printf("你现在毕业开始工作了,你的自力更生能力值为:");
                    scanf_s("%d", &zizu);
                }
                else if (j == 60)
                {
                    printf("你的颜值:衰老。");
                }
                printf("\n");
            }
        }
        else
        {
            printf("你是一个男孩\n");
        }

    }


    return 0;
}

您可以试试以下的代码:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
    srand(time(NULL)); // 初始化随机数种子

    int age;
    int beauty = 50; // 初始颜值为50

    for (age = 1; age <= 100; age++)
    {
        printf("你%d岁了\n", age);

        if (age == 6)
        {
            printf("你需要上小学了\n");
        }
        else if (age == 18)
        {
            printf("你成年了\n");
        }
        else if (age == 30)
        {
            printf("你进入了而立之年\n");
        }
        else if (age == 50)
        {
            printf("你半百了\n");
        }
        else if (age == 60)
        {
            printf("你退休了\n");
        }
        else if (age == 80)
        {
            printf("你成为了长寿老人\n");
        }

        // 随机事件
        int event = rand() % 10; // 生成0~9的随机数
        if (event == 0)
        {
            printf("你遇到了一位好心人,颜值+5\n");
            beauty += 5;
        }
        else if (event == 1)
        {
            printf("你被蚊子咬了,颜值-2\n");
            beauty -= 2;
        }
        // 添加其他事件
        // ...

        printf("你的颜值为%d\n", beauty);
        printf("\n"); // 换行

        // 暂停程序,等待用户按下回车键
        getchar();
    }

    return 0;
}

这个程序使用了for循环来模拟从1岁到100岁的年龄循环。在特定的年龄,会输出相应的事件。随机事件可以通过生成随机数来实现,这里使用了rand()函数。程序在输出每个年龄和事件后都会等待用户按下回车键才会继续执行,这样可以让用户逐句阅读。