コードを書くのはブラックジャックです。 コンパイルできません。警告が発生します。 暗黙の定数変換で複数文字の定数とオーバーフロー 何が起こっているか教えてください。 私はそれを長い時間の間PLZ助けてくれたと思っています。暗黙定数変換で複数文字の定数とオーバーフロー
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int flower;
int k;
int add [13]={1,2,3,4,5,6,7,8,9,10,10,10,10};
char flower_all [4]={'\3','\4','\5','\6'};
char number_all [13]={'A','2','3','4','5','6','7','8','9','10','J','Q','K'};
char player_f[13],player_n[13];
char com_f[13],com_n[13];
int poker [52]={0};
int i,j,y,num,ans;
int player_p=0,com_p=0;
void wash(){
int k;
k=rand()%52;
while(poker[k]==1)
{
k=rand()%52;
}
poker[k]=1;
}
void give_card_p(){
char player_f[13],player_n[13];
int i,k;
int ans;
printf("請問是否要補牌? 1:要 2:不要");
scanf("%d",&ans);
fflush(stdin);
while (ans==1){
wash();
player_f[i]=flower_all[k/13];
player_n[i]=number_all[k%13];
player_p+=add[k%13];
continue;
if (player_p>21)
break;
}
}
int main(){
srand(time(0));
char player_f[13],player_n[13];
int k;
for(i=0;i<2;i++){
wash();
player_f[i]=flower_all[k/13];
player_n[i]=number_all[k%13];
player_p+=add[k%13];
}
for (i=0;i<2;i++){
wash();
com_f[i]=flower_all[k/13];
com_n[i]=number_all[k%13];
com_p+=add[k%13];
}
printf("%c%c",player_f[i],player_n[i]);
fflush(stdin);
return 0;
}
[mvce](http://stackoverflow.com/help/mcve)の作成を検討してください。また、エラーメッセージの全文を含めて、どの行が失敗しているのかを示してください。 –