首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴yanzifan的代码贴C语言
#include <stdio.h>      
main()
{  
    int i,x,y;                 //定义一副牌,由于没有10这个字符,所以在定义时用字符0代表10
    char card[52][2]={{'3','A'},{'3','2'},{'3','3'},{'3','4'},{'3','5'},{'3','6'},{'3','7'},{'3','8'},{'3','9'},{'3','0'},{'3','J'},{'3','Q'},{'3','K'},
    {'4','A'},{'4','2'},{'4','3'},{'4','4'},{'4','5'},{'4','6'},{'4','7'},{'4','8'},{'4','9'},{'4','0'},{'4','J'},{'4','Q'},{'4','K'},
    {'5','A'},{'5','2'},{'5','3'},{'5','4'},{'5','5'},{'5','6'},{'5','7'},{'5','8'},{'5','9'},{'5','0'},{'5','J'},{'5','Q'},{'5','K'},
    {'6','A'},{'6','2'},{'6','3'},{'6','4'},{'6','5'},{'6','6'},{'6','7'},{'6','8'},{'6','9'},{'6','0'},{'6','J'},{'6','Q'},{'6','K'}},temp[2];     
     
    for(i=0;i<100;i++)      //洗牌
    {          
        x=rand()%52;
......................
阅读全部 | 2011年12月8日 18:31
1
yanzifan