输出骰子点数
来源:互联网 发布:江山国色txt下载知轩 编辑:程序博客网 时间:2024/04/30 15:43
/* * Copyright (c) 2013, 烟台大学计算机学院* All rights reserved.* 作 者: 马广明* 完成日期:2014 年 3 月 19 日* 版 本 号:v1.0* 输入描述:无* 问题描述:玩骰子* 程序输出:骰子点数* 问题分析:运用类* 算法设计:略*/#include <iostream>#include<cstdlib>#include<ctime>using namespace std;class S{private: int ds;public: void yao(); void setyao(int number); void getyao();};void S::setyao(int number){ ds=number;}void S::getyao(){ if(ds<1||ds>6) { ds=1; } cout<<ds<<' ';}void S::yao(){ S s; srand(time(0)); for(int i=0; i<10; i++) { int number; number=rand()%6+1; s.setyao(number); s.getyao(); }}int main(){ S s; s.yao(); return 0;}
0 0
- 输出骰子点数
- 骰子点数的概率
- 骰子点数问题
- n个骰子的点数
- n 个骰子的点数
- n个骰子的点数
- n个骰子的点数
- n个骰子的点数
- N个骰子的点数
- n个骰子的点数
- n个骰子的点数
- n个骰子的点数
- n个骰子的点数
- n个骰子的点数
- n个骰子的点数
- n个骰子的点数
- 题目1255:骰子点数概率
- n个骰子的点数
- 面向对象(11)(static静态详解)②(以及制作文档和对象运行流程1)
- HDU 2896 病毒传播 AC 自动机 蛮裸的。。
- DOS环境
- 组合索引
- 利用jquery给指定的table动态添加一行、删除一行
- 输出骰子点数
- || 连接运算符
- Char* 与 LPCTSTR 类型的互相转换
- 一台机器安装多套hadoop环境 端口冲突的解决
- j-link 下的串口调试
- 最新版eclipse支持java8
- Android应用程序发送广播(sendBroadcast)的过程分析
- 八大排序简单小结及c++实现
- pair用法