回答編集履歴
1
じゃ、違う表記も
test
CHANGED
@@ -77,3 +77,57 @@
|
|
77
77
|
}
|
78
78
|
|
79
79
|
```
|
80
|
+
|
81
|
+
または、
|
82
|
+
|
83
|
+
```
|
84
|
+
|
85
|
+
#include <stdio.h>
|
86
|
+
|
87
|
+
int main()
|
88
|
+
|
89
|
+
{
|
90
|
+
|
91
|
+
int num = 0;
|
92
|
+
|
93
|
+
int i;
|
94
|
+
|
95
|
+
char first[512];
|
96
|
+
|
97
|
+
char last[512];
|
98
|
+
|
99
|
+
int f = 0, l = 0;
|
100
|
+
|
101
|
+
scanf("%d", &num);
|
102
|
+
|
103
|
+
for (i = 0; i < num; i++) {
|
104
|
+
|
105
|
+
scanf("%s%s", &first[f], &last[l]);
|
106
|
+
|
107
|
+
while (first[f++]);
|
108
|
+
|
109
|
+
while (last[l++]);
|
110
|
+
|
111
|
+
}
|
112
|
+
|
113
|
+
printf("------------\n");
|
114
|
+
|
115
|
+
f = 0;
|
116
|
+
|
117
|
+
l = 0;
|
118
|
+
|
119
|
+
for (i = 0; i < num; i++) {
|
120
|
+
|
121
|
+
printf("%s %s\n", &last[l], &first[f]);
|
122
|
+
|
123
|
+
while (first[f++]);
|
124
|
+
|
125
|
+
while (last[l++]);
|
126
|
+
|
127
|
+
}
|
128
|
+
|
129
|
+
return 0;
|
130
|
+
|
131
|
+
}
|
132
|
+
|
133
|
+
```
|