Improved licensing procedure

xiaoxiao2021-03-05  28

This procedure has great improvements in time and space than the last published licensing program, and the algorithm is more efficient, and the source code is more streamlined. Welcome to your advice #include #include #include #include

Main () {char card [5] [50]; char coundcard [] = {'2', '2', '3', '3', '4', '4', '5', '5' , '6', '6', '7', '7', '8', '8', '9', '9', '1', '1', 'J', 'J', ' Q ',' q ',' k ',' k ',' a ',' a '}; char cardjoker [] = {' j ',' r ',' j ',' r ',' J ', 'R', 'J', 'R'}; / * JR means Xiao Wang, JR means the king * / char * pr [] = {"EAST", "South", "West", "north"}; int I, J, P [5], Player, P_max [5] = {25, 25, 25, 25, 8}; / * p [] Store the number of players, Player means players, 4 indicates the bottom card * /

Printf ("/ n / n / n *********************************************** *************************** / N "); Printf (" * * / n " ); Printf ("* copyright belonged to MB459 * / N"); printf ("* mb459@sohu.com qq: 83981459 * / n"); Printf ("* * / n"); printf ("*** *********************************************************** ************************** / N / N / N / N "); for (i = 0; i <5; i ) P [ I] = 0; SRAND (NULL);

For (i = 3; i <7; i ) for (j = 0; j <26; j ) {Player = rand ()% 108/25; / * Random generated will get the current card player * / if (p [Player] == p_max [player]) {J -; Continue;} else {card [player] [p [player] * 2] = i; card [player] [p [player] * 2 1] = CardCard [J]; P [Player] ;}} for (i = 0; i <7; i = 2) / * Processing Size King * / {Player = RAND ()% 108/25; IF (P [ Player] == p_max [player]) {i- = 2; Continue;} else {card [player] [p [player] * 2] = cardJoker [i]; card [player] [P [Player] * 2 1] = cardJoker [i 1]; p [player] ;}} for (i = 0; i <4; i ) / * Print player's card * / {Printf ("% s: / n", Pr [I]); for (j = 0; j <50; j ) {printf ("% c", card [i] [j]); if (Card [i] [j] == '1') Printf ("0");} printf ("/ n");} printf ("the left cards: / n"); / * Print bottom card * / for (i = 0; i <16; i ) {Printf ( "% C", card [4] [i]); if (Card [4] [i] == '1') Printf ("0");} Printf ("/ n"); getChe ();}

转载请注明原文地址:https://www.9cbs.com/read-33345.html

New Post(0)