fgets (pn->first, SLEN, stdin);
i = 0;
while (pn->first[i] != '/n' && pn->first[i] != '/0')
i++;
if (pn->first[i] == '/n')
pn->first[i] = '/0';
else
while (getchar () != '/n')
continue;
利用fgets代替gets
最新推荐文章于 2021-06-25 17:26:42 发布
fgets (pn->first, SLEN, stdin);
i = 0;
while (pn->first[i] != '/n' && pn->first[i] != '/0')
i++;
if (pn->first[i] == '/n')
pn->first[i] = '/0';
else
while (getchar () != '/n')
continue;