登录
首页 » 算法 » 一个简单的c语言实现的纸牌程序

一个简单的c语言实现的纸牌程序

于 2022-01-29 发布 文件大小:217.53 kB
0 123
下载积分: 2 下载次数: 1

代码说明:

用一个具有52个元素的数组(如char p[52][5])存放这52张牌的内容,如P_i表示黑桃、H_i表示红桃、C_i表示梅花、D-i表示方块;程序中可以首先初始化该数组,然后显示菜单等待用户选择输入,用户选择“发牌”,程序调用“发牌”函数;在发牌函数中,可使用C 中的产生随机数的函数(参看rand(),srand(),random()等函数的使用说明)一个随机数m,选取一张牌{p[m]},将其与最前面的牌交换位置,即将选取的牌放在最前面;然后对数组p余下的牌重复选取操作,直到所有牌均重排列;最后按13行*4列输出发牌结果

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 赫夫曼编码树的应用
    利用赫夫曼编码树的原理压缩和解压
    2023-02-10 02:25:03下载
    积分:1
  • 单片机输入c源代码
    纯C语言编写的输入法源代码,主要用于单片机,有需要的可以下载! 使用说明: 拼音输入法杳询函数: unsigned char code * py_ime(unsigned char input_py_val[]); input_py_val为已输入的拼音码字符串头指针, 反回值为中文的起始地址,当为0时,杳询失败 应用举例: {     unsigned char input_string[]={"bang"};     unsigned char chines_string[100];     sprintf(chines_string,"%s",py_ime(input_string)); }
    2023-08-15 12:10:04下载
    积分:1
  • (原创)非常有用的公历转农历、农历转公历(农历数据至2100年)
    从1920至2100年近200年的公历转农历,农历转公历算法代码,完全正确,无需修改直接使用。
    2022-03-20 14:14:20下载
    积分:1
  • FORTRAN编写的差分程序,用于计偏微分方程,有用。
    FORTRAN编写的差分程序,用于计算偏微分方程,有用。-FORTRAN differential preparation procedures used to calculate the partial differential equations, useful.
    2022-03-21 06:13:27下载
    积分:1
  • 矩阵求逆c语言
    矩阵求逆c语言算法!-matrix inversion algorithm c language!
    2022-05-24 18:25:02下载
    积分:1
  • lisp语言用Delaunay三角网求土石方量
    本程序为lisp语言编写的AutoCAD二次开发程序,包括lisp源程序代码和程序测试图。 本程序适合AutoCAD二次开发初学者学习之用,代码比较简单,所用函数也都是基本的函数,并且程序中包含详细注释。适合大学测绘、采矿等工科类学生学习使用。 本程序程序功能: 三角网法土石计算,采用“插点法”构建Delaunay三角网,并求出土石方总体积。 说明:插点法构建Delaunay三角网程序来自AutoDesk讨论组。
    2023-07-05 05:35:03下载
    积分:1
  • 一个以文本格式存储的矩阵的相关系数矩阵,包括例子数据。...
    计算一个以文本格式存储的矩阵的相关系数矩阵,包括例子数据。-calculated a text format to store the correlation coefficient matrix of matrices, including examples of data.
    2022-02-02 21:59:59下载
    积分:1
  • C#计
    using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Runtime.InteropServices; using System.IO; namespace 计算器 { /// /// Form1 的摘要说明。 /// public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Label label1; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button4; private System.Windows.Forms.Button button5; private System.Windows.Forms.Button button6; private System.Windows.Forms.Button button7; private System.Windows.Forms.Button button8; private System.Windows.Forms.Button button9; private System.Windows.Forms.Button button11; private System.Windows.For
    2023-01-30 17:15:03下载
    积分:1
  • 《牛顿差值》
    计算方法《牛顿差值》-calculation method, "Newton margin"
    2022-02-07 00:30:34下载
    积分:1
  • 利用横向递归解决数据组合的问题, 比如数组为a, 长度为len, 横向递归 B display(a,len) b是二维数组,a是一维数组...
    利用横向递归算法解决数据组合的问题, 比如数组为a, 长度为len, 横向递归 B display(a,len) b是二维数组,a是一维数组-the use of horizontal recursive algorithm to solve the problem of data sets, such as the array is a length of len, horizontal display recursive B (a, len) b is the two-dimensional array, is a one-dimensional arrays
    2022-03-23 12:54:55下载
    积分:1
  • 696518资源总数
  • 105678会员总数
  • 22今日下载