removed gets() function
This commit is contained in:
parent
c29418ea65
commit
6261414732
12
distance.c
12
distance.c
@ -62,7 +62,15 @@ int main(int argc, char **argv) {
|
|||||||
for (a = 0; a < N; a++) bestd[a] = 0;
|
for (a = 0; a < N; a++) bestd[a] = 0;
|
||||||
for (a = 0; a < N; a++) bestw[a][0] = 0;
|
for (a = 0; a < N; a++) bestw[a][0] = 0;
|
||||||
printf("Enter word or sentence (EXIT to break): ");
|
printf("Enter word or sentence (EXIT to break): ");
|
||||||
gets(st1);
|
a = 0;
|
||||||
|
while (1) {
|
||||||
|
st1[a] = fgetc(stdin);
|
||||||
|
if ((st1[a] == '\n') || (a >= max_size - 1)) {
|
||||||
|
st1[a] = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
a++;
|
||||||
|
}
|
||||||
if (!strcmp(st1, "EXIT")) break;
|
if (!strcmp(st1, "EXIT")) break;
|
||||||
cn = 0;
|
cn = 0;
|
||||||
b = 0;
|
b = 0;
|
||||||
@ -124,4 +132,4 @@ int main(int argc, char **argv) {
|
|||||||
for (a = 0; a < N; a++) printf("%50s\t\t%f\n", bestw[a], bestd[a]);
|
for (a = 0; a < N; a++) printf("%50s\t\t%f\n", bestw[a], bestd[a]);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user