Better yet to use fgets() followed by sscanf() : char tmp[20]; if (!fgets(tmp, sizeof tmp, stdin)) /* erro */; if (sscanf(tmp, "%d", ...
確定! 回上一頁