質問編集履歴
2
スペルミス
test
CHANGED
File without changes
|
test
CHANGED
@@ -23,18 +23,18 @@
|
|
23
23
|
typedef struct{
|
24
24
|
char name[10];
|
25
25
|
int age;
|
26
|
-
}pe
|
26
|
+
}people;
|
27
27
|
|
28
|
-
void infunc(pe
|
28
|
+
void infunc(people *data);
|
29
|
-
void outfunc(pe
|
29
|
+
void outfunc(people *data);
|
30
30
|
int main(void){
|
31
|
-
pe
|
31
|
+
people data[NUM];
|
32
32
|
infunc(data);
|
33
33
|
outfunc(data);
|
34
34
|
return 0;
|
35
35
|
}
|
36
36
|
|
37
|
-
void infunc(pe
|
37
|
+
void infunc(people *data){
|
38
38
|
int i;
|
39
39
|
printf("名前...\n");
|
40
40
|
for(i=0;i<NUM;i++){
|
@@ -47,7 +47,7 @@
|
|
47
47
|
return;
|
48
48
|
}
|
49
49
|
|
50
|
-
void outfunc(pe
|
50
|
+
void outfunc(people *data){
|
51
51
|
int i;
|
52
52
|
for(i=0;i<NUM;i++){
|
53
53
|
printf("名前[i]=%s 年齢[i]=%d\n",data[i].name,data[i].age);
|
1
scanfに\nを付けてしまったため修正した
test
CHANGED
File without changes
|
test
CHANGED
@@ -38,11 +38,11 @@
|
|
38
38
|
int i;
|
39
39
|
printf("名前...\n");
|
40
40
|
for(i=0;i<NUM;i++){
|
41
|
-
scanf("%s
|
41
|
+
scanf("%s",data[i].name);
|
42
42
|
}
|
43
43
|
printf("年齢...\n");
|
44
44
|
for(i=0;i<NUM;i++){
|
45
|
-
scanf("%d
|
45
|
+
scanf("%d",&data[i].age);
|
46
46
|
}
|
47
47
|
return;
|
48
48
|
}
|