Get the App
SLTechnology News&Howtos  ›  Development  › 

How to deal and shuffle cards in C language

Shulou Source: shulou.com Published: 2022-05-31 18:29:43 10月03日 Update

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)

Tags: Diamonds clubs spades hearts programs individuals languages articles content functions king cards Xiao Wang two people proper two ideas new knowledge more modules Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Redmi Shulou Information MariaDB OPPO Reno