You should declare the function before you use itmain() is an exception. All the other functions need to be declared before use. Just put your function prototype at the beginning of the program.
BTW: It's better to use than (more...)
只要把下面的函数体整个放到main前面就行了。
不一定非要declare。