菜鸟求助 error LNK2001: unresolved external symbol "int __cdecl count(int)" (?count@

苏颙 2012-11-27 05:37:58
error LNK2001: unresolved external symbol "int __cdecl count(int)" (?count@@YAHH@Z)

代码如下:
#include<iostream>
#include<Cmath>
using namespace std;
int score[50];
int num;
void input_score();
int get_max_score();
int get_min_score();
double get_avg_score();
double get_stdev_score();
int count(int);
void output_index(int);

int main(void)
{
int max_score,min_score;
cout<<"小组共有多少名同学?";
cin>>num;
cout<<endl<<"请输入学生成绩:"<<endl;
input_score();
max_score=get_max_score();
cout<<endl<<"最高成绩为:"<<max_score<<",共有"<<count(max_score)<<"人。";
min_score=get_min_score();
cout<<endl<<"最低成绩为:"<<min_score<<",共有"<<count(min_score)<<"人。";
cout<<"平均成绩为:"<<get_avg_score();



return 0;
}
void input_score()
{
int i;
for(i=1;i<=num;i++)
do
{
cout<<"输入第"<<i<<"位同学的成绩:";
cin>>score[i];
}while(score[i]<0||score[i]>100);
return;
}
int get_max_score()
{ int i;
for(i=1;i<=num;i++)
{
if(score[i]>=score[i+1])
score[i+1]=score[i];
}
return score[i];
}
int get_min_score()
{
int i;
for(i=1;i<=num;i++)
{
if(score[i]<=score[i+1])
score[i+1]=score[i];
}
return score[i];
}
double get_avg_score()
{
int sum=0,c,i;
for(i=1;i<=num;i++)
sum=score[i]+sum;
c=sum/num;
return c;
}
编译不报错 连接就出错了,刚开始学c++ 求大大帮助啊
...全文
350 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
有点清眸 2012-11-27
  • 打赏
  • 举报
回复
连接不到int __cdecl count(int)这个函数,说明它在外面没有定义~~ 如果已经定义了,检查一下编译时include 的文件。
nightkids_008 2012-11-27
  • 打赏
  • 举报
回复
莫有实现。。。。
转角天边 2012-11-27
  • 打赏
  • 举报
回复
int count(int);只声明没定义
hznat 2012-11-27
  • 打赏
  • 举报
回复
int count(int); 没有实现
mymtom 2012-11-27
  • 打赏
  • 举报
回复
count函数在哪里呢?

64,654

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧