<を半角に置換してください
>を半角に置換してください。
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main(void)
{
char *hand[] ={"グー","チョキ","パー"};
char *jud[] = {"あなたの勝ち","あなたと引き分け","あなたの負け"};
char *mes[] = {"私は「%s」で、%sです。\n","不正な入力です。","1:グー, 2:チョキ, 3:パーを入力:","『%c』\n"};
int yh,oh,hn,f=1;
char inp;
hn = sizeof(hand)/sizeof(hand[0]);
while(f) //勝ちの場合は0となり抜ける
{
oh = rand()%hn; //相手の手を乱数で取得
printf(mes[2]); //入力を促す表示
inp = getch(); //一文字取得
printf(mes[3],inp); //プレイヤーが入力した文字を表示
yh = inp - '1'; //機種依存設定 文字コードの1が数字の0になるように計算
if(yh>=0 & yh <hn){ //1~3が入力されていれば処理する
f = (yh - oh + 4) % hn ; //じゃんけん一発判定この式だけで判定可能。
printf(mes[0],hand[oh],jud[f]); //判定を表示
}
else printf(mes[1]); //不正な入力の表示
}
return 0;
}
![post-title](https://i.ytimg.com/vi/4kU-d9e4aT8/hqdefault.jpg)