#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define max 21
int main( ) {
char naipe, nome[ 50 ] , op;
char tipo[ 14 ] = { 'A' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'T' , 'J' , 'Q' , 'K' } ;
int valor, valorb, soma= 0 , somab= 0 ;
int i, din= 1000 ;
int aposta, taposta= 0 ;
printf ( "Digite o seu nome:\n " ) ; op= 'S' ;
do {
printf ( "VocĂȘ tem %d unidades\n " , din
) ; printf ( "Escolha sua aposta inicial, %s:\n " , nome
) ; printf ( "Digite 1 para 10 unidades\n " ) ; printf ( "Digite 2 para 20 unidades\n " ) ; printf ( "Digite 3 para 50 unidades\n " ) ; } while ( aposta< 1 || aposta> 3 ) ;
switch ( aposta) {
case 1 :
taposta+= 10 ;
break ;
case 2 :
taposta+= 20 ;
break ;
case 3 :
taposta+= 50 ;
break ;
}
while ( ( op== 's' ) || ( op== 'S' ) ) {
if ( ( i== 10 ) || ( i== 11 ) || ( i== 12 ) || ( i== 13 ) )
valor= 10 ;
else if ( i== 1 )
valor= 1 ;
else
valor= i;
soma= ( soma+ valor) ;
if ( ( i== 10 ) || ( i== 11 ) || ( i== 12 ) || ( i== 13 ) )
valorb= 10 ;
else if ( i== 1 )
valorb= 1 ;
else
valorb= ( i+ 1 ) ;
somab= ( somab+ valorb) ;
printf ( "VocĂȘ marcou %d pontos e tem um total de %d pontos.\n " , valor
, soma
) ; printf ( "O computador marcou %d pontos e tem um total de %d pontos.\n " , valorb
, somab
) ; printf ( "Deseja fazer a jogada? [S/N]\n " ) ;
printf ( "Selecionou S/N: %c\n " , op
) ; }
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHRpbWUuaD4gCiNkZWZpbmUgbWF4IDIxCgppbnQgbWFpbigpIHsKICAgIGNoYXIgbmFpcGUsIG5vbWVbNTBdLCBvcDsKICAgIGNoYXIgdGlwb1sxNF0gPSB7J0EnLCcyJywn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ChpPT0xMykpCiAgICAgICAgICAgIHZhbG9yPTEwOwogICAgICAgIGVsc2UgaWYgKGk9PTEpCiAgICAgICAgICAgIHZhbG9yPTE7CiAgICAgICAgZWxzZQogICAgICAgICAgICB2YWxvcj1pOwogICAgICAgIG5haXBlPXJhbmQoKSUzKzM7CiAgICAgICAgc29tYT0oc29tYSt2YWxvcik7CgogICAgICAgIHByaW50ZigiX19fX19fX19fXG4iKTsKICAgICAgICBwcmludGYoInwlYyAgICAgIHxcbiIsbmFpcGUpOwogICAgICAgIHByaW50ZigifCAgICAgICB8XG4iKTsKICAgICAgICBwcmludGYoInwgICAlYyAgIHxcbiIsdGlwb1tpXSk7CiAgICAgICAgcHJpbnRmKCJ8ICAgICAgIHxcbiIpOwogICAgICAgIHByaW50ZigifCAgICAgICVjfFxuIixuYWlwZSk7CiAgICAgICAgcHJpbnRmKCItLS0tLS0tLS1cbiIpOwoKICAgICAgICBpPXJhbmQoKSUxMisxOwogICAgICAgIGlmICgoaT09MTApIHx8IChpPT0xMSkgfHwgKGk9PTEyKSB8fCAoaT09MTMpKQogICAgICAgICAgICB2YWxvcmI9MTA7CiAgICAgICAgZWxzZSBpZiAoaT09MSkKICAgICAgICAgICAgdmFsb3JiPTE7CiAgICAgICAgZWxzZQogICAgICAgICAgICB2YWxvcmI9KGkrMSk7CiAgICAgICAgbmFpcGU9cmFuZCgpJTMrMzsKICAgICAgICBzb21hYj0oc29tYWIrdmFsb3JiKTsKCiAgICAgICAgcHJpbnRmKCJfX19fX19fX19cbiIpOwogICAgICAgIHByaW50ZigifCVjICAgICAgfFxuIixuYWlwZSk7CiAgICAgICAgcHJpbnRmKCJ8ICAgICAgIHxcbiIpOwogICAgICAgIHByaW50ZigifCAgICVjICAgfFxuIix0aXBvW2ldKTsKICAgICAgICBwcmludGYoInwgICAgICAgfFxuIik7CiAgICAgICAgcHJpbnRmKCJ8ICAgICAgJWN8XG4iLG5haXBlKTsKICAgICAgICBwcmludGYoIi0tLS0tLS0tLVxuIik7CiAgICAgICAgcHJpbnRmKCJcbiIpOwogICAgICAgIHByaW50ZigiVm9jw6ogbWFyY291ICVkIHBvbnRvcyBlIHRlbSB1bSB0b3RhbCBkZSAlZCBwb250b3MuXG4iLHZhbG9yLHNvbWEpOwogICAgICAgIHByaW50ZigiTyBjb21wdXRhZG9yIG1hcmNvdSAlZCBwb250b3MgZSB0ZW0gdW0gdG90YWwgZGUgJWQgcG9udG9zLlxuIix2YWxvcmIsc29tYWIpOwogICAgICAgIHByaW50ZigiXG4iKTsKICAgICAgICBwcmludGYoIkRlc2VqYSBmYXplciBhIGpvZ2FkYT8gW1MvTl1cbiIpOwoKICAgICAgICB3aGlsZSAoIGdldGNoYXIoKSAhPSAnXG4nICk7CiAgICAgICAKICAgICAgICBzY2FuZigiJWMiLCZvcCk7CgogICAgICAgIHByaW50ZigiU2VsZWNpb25vdSBTL046ICVjXG4iLCBvcCk7CiAgICB9Cn0=