⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shuffler.c

📁 在Linux编程环境下实现Shuffle排序算法
💻 C
字号:
/**
*  @file    shuffler.c
*  @brief   This main function to test the  shuffler() function
*  @author  Zhao Dong   zhdo0104@163.com
*  @date    2008/6/24
*/

#include <stdio.h>
#include"myshuffler.h"
#define NUM_CARDS  54

void cards_input(int * pcards)
{
     int i;
     for(i=0;i<NUM_CARDS;i++)
     {
          pcards[i]=i+1;                 
     }     
}

void cards_output(int * pcards)
{
     int i=0,j=0;
     for(i=0;i<NUM_CARDS;i++)
     {
          printf("%02d\t",pcards[i]);
          j++;
          if(j==10)
          {
                 printf("\n");
                 j=0;         
          }                 
     }  
     printf("\n");   
}

int main()
{
     int cards[54];
     int *pcards=cards;
     
     cards_input(pcards);
     shuffler(pcards);
     cards_output(pcards);
     
     return 1;    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -