• 2021-04-14
    模拟骰子的6000次投掷,编程统计并输出骰子的6个面各自出现的概率。按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。()
    #include _________
    #include
    #include
    int main()
    {
    int face, roll, frequency[7] = {0};
    srand(time (NULL));
    for (roll=1; roll<=6000; roll++)
    {
    face = _____________;
    __________________;
    }
    printf("%4s%17s
    ", "Face", "Frequency");
    for (face=1; face<=6; face++)
    {
    printf("%4d%17d
    ", face, frequency[face]);
    }
    return 0;
    }