質問編集履歴
1
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
int n;
|
14
14
|
|
15
|
-
void fun1 (int a[n])
|
15
|
+
void fun1 (int a[n]) /*カードを決める関数です*/
|
16
16
|
{
|
17
17
|
for(int i = 0;i < n;i++){
|
18
18
|
printf("%d枚目",i+1);
|
@@ -21,7 +21,7 @@
|
|
21
21
|
|
22
22
|
}
|
23
23
|
|
24
|
-
void fun2 (int *a,int *c,int *eat, int *bite)
|
24
|
+
void fun2 (int *a,int *c,int *eat, int *bite) /*カードがあっているかを確認する関数です*/
|
25
25
|
{
|
26
26
|
for (int i = 0;i < n;i++){
|
27
27
|
if(a[i] == c[i]){
|
@@ -35,7 +35,7 @@
|
|
35
35
|
}
|
36
36
|
}
|
37
37
|
|
38
|
-
void fun3(int *c,int m)
|
38
|
+
void fun3(int *c,int m) /*入力したカードに重なりがないかを確認する関数です*/
|
39
39
|
{
|
40
40
|
do{
|
41
41
|
fun1(c);
|
@@ -76,19 +76,18 @@
|
|
76
76
|
for (w=0;w < 100;w++){
|
77
77
|
*eat1 = 0;
|
78
78
|
*bite1 = 0;
|
79
|
-
printf("%dEAT,%dBITE",eat,bite);
|
80
79
|
printf("%sさんは%sさんのカードを当ててください\n",p,q);
|
81
|
-
fun3(n,m);
|
80
|
+
fun3(n,m);/*カードを入力して同じ数字がないかを確認*/
|
82
81
|
if(c[0] == -1){break;}
|
83
|
-
fun2 (b,c,eat1,bite1);
|
82
|
+
fun2 (b,c,eat1,bite1);/*カードの比較*/
|
84
83
|
printf("%dEAT,%dBITE",eat,bite);
|
85
84
|
if(eat == n){break;}
|
86
85
|
*eat1 = 0;
|
87
86
|
*bite1 = 0;
|
88
87
|
printf("\n%sさんは%sさんのカードを当ててください\n",q,p);
|
89
|
-
fun3(c,m);
|
88
|
+
fun3(c,m); /*カードを入力して同じ数字がないかを確認*/
|
90
89
|
if(c[0] == -1){break;}
|
91
|
-
fun2(a,c,eat1,bite1);
|
90
|
+
fun2(a,c,eat1,bite1);/*カードの比較*/
|
92
91
|
printf("%dEAT,%dBITE\n",eat,bite);
|
93
92
|
if(eat == n){break;}
|
94
93
|
}
|