すみません、超初心者でさらに独学で勉強してるものなのですが、下の getint の書き方では、後に数字の付かない + あるいは - は、
ゼロの正しい表現として扱われる。そうした文字を入力に戻すように、このプログラムを直した上でmain を付けて、動作するプログラムを作れ。
っという問題がわかりません。教えてください
#include <ctype.h>

int getch(void);
void ungetch(int);

int getint(int *pn)
{
int c, sign;

while (isspace(c = getch()))
;
if (!isdigit(c) && c != EOF && c != '+' && c!= '-'){
ungetch(c);
return 0;
}
sign = (c =='-') ? -1: 1;
if (c == '+' || c == '-')
c = getch();
for (*pn = 0; isdigit(c); c = getch())
*pn = 10 * *pn + (c - '0');
*pn *= sign;
if (c != EOF)
ungetch(c);
return c;
}