填空题
以下程序的功能是:通过函数func输入字符并统计输入字符的个数,输入时用字符@作为输入结束标志。请填空。
#include<stdio.h>
long______; /*函数说明语句*/
main()
long a;
a=func(); printf("n=%1d/n", a);
long func()
long b;
for(b=0; getchar()!='@'; b++; );
return b;
【正确答案】
1、func()
【答案解析】[解析] 空白处为函数说明语句,其格式为:
函数返回值的数据类型函数名(参数类型1,参数类型2,……)。