重学C++ 数组 掷骰子程序
来源:互联网 发布:程序员架构师转型必备 编辑:程序博客网 时间:2024/06/05 04:34
//原始程序来自C++程序员教程
#include<iostream>using std::cout;using std::endl;#include <iomanip>using std::setw;#include <cstdlib>using std::rand;using std::srand;#include<ctime>using std::time;int main(){const int arraySize=7;int frequency[arraySize]={};srand(time(0));for(int roll=1;roll<=6000000;roll++){frequency[1+rand()%6]++;}cout<<"FACE:"<<setw(13)<<"Frequency"<<endl;for(int face=1;face<arraySize;face++){cout<<setw(4)<<face<<setw(13)<<frequency[face]<<endl;}return 0;}
- 重学C++ 数组 掷骰子程序
- 重学C++ switch 投掷骰子
- 重学c++:函数和数组
- 重学C语言(一) 字符串数组输出
- 指针与数组【重学C之五】
- 重学C语言
- 重学C语言
- 【重学C/C++】句柄
- 【程序12】模拟掷骰子游戏
- 简单C++程序——掷骰子
- 掷骰子的小程序 HTML5
- 掷骰子游戏-C语言实现
- 重学c语言_1
- 重学c语言_2
- 重学c语言_3
- C 数组排重
- 数组查重(C++)
- 【重学《C++Primer第四版》】第四章、数组和指针
- MySQL主从复制配置
- 啥叫SSO?
- 调整数组顺序使奇数位于偶数前面
- 进程通信系列-消息缓冲
- jdk与tomcat的环境配置
- 重学C++ 数组 掷骰子程序
- hdu 1171 Big Event in HDU
- saltstack官方文档——Command Line Reference
- Disable the authentication loopback check for SharePoint
- 状态栏关机按钮改为关屏
- ubuntu TFTP设置配置
- saltstack官方文档——Configuring the Salt Master
- GDB Python pretty printers配置打印c++中stl库容器
- 10167 - Birthday Cake//枚举