|
#include <stdio.h>
int getinput(void);
void printmessage(int counter,int input);
int main(void)
{
int counter;
int input;
for (counter=0;counter<=200;counter++)
{
input=getinput();
if (input==-1) end(0);
printmessage(counter,input);
}
int getinput(void)
{
int input;
printf("Enter an integer,or use -1 to exit:");
scanf("%d",&input);
return input;
}
void printmessage(int counter,int input)
{
static int lastnum=0;
counter++;
printf("for number %d,you entered %d (%d more than last time)\n",
counter,input,input-lastnum);
lastnum=input;
}
编译时提示的错误是:
[root@localhost myxh]# gcc -ggdb3 -o test2 test2.c
test2.c: In function `main':
test2.c:52: parse error at end of input
各位大哥,这是错在哪里啊?
谢谢! |
|