C language, change a small program, C language small program

Updated on technology 2024-05-07
3 answers
  1. Anonymous users2024-02-09

    Your app is to deal cards to three people, one player, and two computers. 16 cards per person.

    **As follows: for(i=0; i<16;i++)player[i]=tank[i];

    computer[0][i]=tank[i+16];

    computer[1][i]=tank[i+32];

    There are 4 hole cards left.

    **As follows: for(i=0; i<4;i++)last_four_card[i]=tank[53-i];

    So you're going to give it to two people, and 27 tickets each, ** as follows::

    for(i=0;i<27;i++)

    computer[0][i]=tank[i];

    computer[1][i]=tank[i+27];

  2. Anonymous users2024-02-08

    c/100%9=2,a=2

    1) &&1) is true, the value is 1, and b=1

    The output is 2,1

  3. Anonymous users2024-02-07

    A guessing game c program development: A and B punch to play rock, scissors and paper, the rules of the game are rock, scissors and paper, that is, if A punches the stone, B punches the cloth, then B wins, if A punches the scissors, B punches the cloth, then A wins, and so on.

    2 Problem Analysis.

    1) Different numbers are used to represent rock-paper-scissors, 1-rock, 2-scissors, 3-paper, 0-end, other numbers are invalid, and re-loss is required;

    2) The game program requires A to enter a number and B to enter a number;

    3) Judge the winner or loser according to the meaning of the number entered by A and B;

    4) The program uses a loop structure and terminates the game when it encounters 0.

    3 Flowchart.

    4 c**。

    #include

    int main()

    while(p==0);

    printf("B:");

    scanf("%d",&b);

    if(b==0) break;do}

    while(p==0);

    printf("");

    t=a-b;

    if(t==0) printf("Draw! ");

    elseif(t==-1||t==2)

    printf("A win! B loses! ");

    else printf("B wins! A loses! ");

    printf("Game over! ");

    return 0;}

Related questions
7 answers2024-05-07

In the whole main function, only this one variable, whether it is the first for or the second for, is the same i, the second for will have i=-1, in the case of i= -1, and printf("%d ",a[i]);Statement. So fear not! When there is no second for the case: >>>More

5 answers2024-05-07

Question 1: pt1=&a;pt2=&b;pt1 and pt2 are not defined, years are defined as. >>>More

7 answers2024-05-07

In the C language. An integer constant starting with 0 refers to octal. 027 is 2x8+7, so the answer is c.

5 answers2024-05-07

Define an array of scores to record scores, record rankings and score bins. >>>More

7 answers2024-05-07

char *p;

uchar log_type; >>>More