回答編集履歴
1
低評価+ベテランの人が正しいであろう回答を送っていたため
test
CHANGED
@@ -1,89 +1 @@
|
|
1
|
-
```c
|
2
|
-
|
3
|
-
#include <stdio.h>
|
4
|
-
|
5
|
-
#include <string.h>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
struct PLAYER {
|
10
|
-
|
11
|
-
int num;
|
12
|
-
|
13
|
-
char name[20];
|
14
|
-
|
15
|
-
char position[3];
|
16
|
-
|
17
|
-
double height;
|
18
|
-
|
19
|
-
};
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
struct PLAYER p[6] = { {10,"Messi","FW",170},
|
24
|
-
|
25
|
-
{20,"Neto","GK",180},
|
26
|
-
|
27
|
-
{30,"Tenas","GK",185},
|
28
|
-
|
29
|
-
{40,"Semedo","MF",175},
|
30
|
-
|
31
|
-
{50,"Tenas","DF",187},
|
32
|
-
|
33
|
-
{60,"Roberto","DF",182} };
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
int main() {
|
38
|
-
|
39
|
-
char buf[20];
|
40
|
-
|
41
|
-
int count = 0;
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
printf("選手の名前>");
|
46
|
-
|
47
|
-
scanf("%s", buf);
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
if (strcmp(buf, "leave") != 0)
|
52
|
-
|
53
|
-
{
|
54
|
-
|
55
|
-
for (int i = 0; i < sizeof(p) / sizeof(struct PLAYER); i++)
|
56
|
-
|
57
|
-
{
|
58
|
-
|
59
|
-
if (strcmp(p[i].name, buf) == 0)
|
60
|
-
|
61
|
-
{
|
62
|
-
|
63
|
-
printf("%d %s %.lfcm\n", p[i].num, p[i].position, p[i].height);
|
64
|
-
|
65
|
-
count++;
|
66
|
-
|
67
|
-
}
|
68
|
-
|
69
|
-
}
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
if (count == 0)
|
74
|
-
|
75
|
-
{
|
76
|
-
|
77
|
-
printf("No match");
|
78
|
-
|
79
|
-
}
|
80
|
-
|
81
|
-
}
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
1
|
+
削除リクエスト済み。
|
86
|
-
|
87
|
-
}
|
88
|
-
|
89
|
-
```
|