How to deal and shuffle cards in C language
In this article, the editor introduces in detail "how to deal and shuffle cards in C language". The content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to deal and shuffle cards in C language" can help you solve your doubts. Let's follow the editor's train of thought to slowly deepen, let's learn new knowledge.
1. Simulated licensing procedure
The shuffling program and the printing licensing program are written by writing two function modules.
two。 Write a shuffle program
Void shuffle (char cards [] [10], int n) {int iTun54; char ca,cb,ct [10]; srand ((unsigned) time (NULL)); while (iMurt -) {ca=rand ()% 54; cb=rand ()% 54; strcpy (ct,cards [ca]); strcpy (cards [ca], cards [cb]); strcpy (cards [CB], ct) }}
3. Write a licensing program for printing
Void printCard (char cards [] [10], int n) {int iMagazine rnomic 0; printf ("the first person:\ n"); for (iMagna Tinci)