13694 - EE2310_Lec_8_1   

Description

#include <stdio.h>
#include <stdlib.h>

typedef struct {
    char suit;
    char face;
} card_t;
/*
 * face's values are 'A', '2',..., 'T', 'J', 'Q', 'K',
 * in which 'T' stands for 10.
 * suit's values are 'S', 'H', 'D', 'C'
 */

void input_card_t(card_t *ptr_card1){
 /*

   Your work here.

*/
}
void output_card_t(card_t *ptr_card1){
/*

   Your work here. Output "10" instead of 'T'

*/ 
    
    
}

int main(){
    card_t card_arr[10];
    for(int i=0; i<10; ++i){
        input_card_t(card_arr + i);
    }
    
    for(int i=0; i<9; ++i){
        output_card_t(card_arr + i);
        printf(" ");
    }
    output_card_t(card_arr + 9);
    printf("\n");

    
    
    return 0;
}

 

Input

S2 H2 D2 CT S8 HA DJ HK HQ C5

 

Output

S2 H2 D2 C10 S8 HA DJ HK HQ C5

 

Sample Input  Download

Sample Output  Download

Tags




Discuss