回答編集履歴
1
コードの改善
test
CHANGED
@@ -66,15 +66,11 @@
|
|
66
66
|
|
67
67
|
if (!isalpha(c)) continue;
|
68
68
|
|
69
|
-
int
|
69
|
+
int j = i;
|
70
70
|
|
71
|
-
|
71
|
+
while (--j >= 0 && c != tolower((unsigned char)city[j])) ;
|
72
72
|
|
73
|
-
if (c == tolower((unsigned char)city[j]))
|
74
|
-
|
75
|
-
count++;
|
76
|
-
|
77
|
-
if (
|
73
|
+
if (j >= 0) continue;
|
78
74
|
|
79
75
|
if (string > base) *string++ = ',';
|
80
76
|
|
@@ -82,7 +78,7 @@
|
|
82
78
|
|
83
79
|
*string++ = ':';
|
84
80
|
|
85
|
-
for (
|
81
|
+
for (j = i; j < n; j++)
|
86
82
|
|
87
83
|
if (c == tolower((unsigned char)city[j]))
|
88
84
|
|