网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
07月29日漏签0天
visual吧 关注:8,995贴子:27,354
  • 看贴

  • 图片

  • 吧主推荐

  • 游戏

  • 0回复贴,共1页
<<返回visual吧
>0< 加载中...

求助各位大神

  • 只看楼主
  • 收藏

  • 回复
  • AndyWong5181
  • 大凡金属
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
这是我在大学里C++的一个功课,题目要求使用两个ARRAYS去输入最多20个学生的名字和分数,和用户可以选择以下个5个功能。功能的程式老师已经给了我们
程式如下
1. 1. int countSize(const float scores[], const stringnames[]);
2. 2. void getMax(float& max, const float scores[],const string names[], int actualSize);
3. 3. float firstMin(const float scores[], const stringnames[], int n);
4. 4. bool find(const float scores[], const string names[],int n, float target);
5. 5. void display(const float scores[], const stringnames[]);
这是我写的程式,可是他不断提示说出现错误0xcccccccc 求大神解答
#include <iostream>
#include <string>
using namespace std;
int countSize(const float scores[], const string names[]);
void getMax(float& max, const float scores[], const string names[], int actualSize);
float firstMin(const float scores[], const string names[], int n);
bool find(const float scores[], const string names[], int n, float target);
void display(const float scores[], const string names[]);
int main()
{
const int size = 20;
int number,n;
char choice;
string name[size];
float scores[size];
cout << "1: Count the number of students\n" << "2: Find the maximum and the minimum scores\n"
<< "3: Find the minimum for the first n elements \n" << "4: Find x from the first n elements\n"
<< "5: Print all the students with their scores\n";
cout << "++++++++++++++++++++++++++++++++++++++++++++++++\n";
cout << "Please enter the students name\n";
cin >> name[size];
cout << "Please enter the students scores\n";
cin >> scores[size];
do
{
cout << "Please enter your choice (1-5)\n";
cin >> number;
switch (number)
{
case 1:
int countSize(const float scores[], const string names[]);
break;
case 2:
void getMax(float& max, const float scores[], const string names[], int actualSize);
break;
case 3:
cout << "Please enter the value for n:\n";
cin >> n;
float firstMin(const float scores[], const string names[], int n);
cout << "The minimum for the first" << n << "elements is" << scores[] << "by" << name[];
break;
case 4:
bool find(const float scores[], const string names[], int n, float target);
break;
default:
void display(const float scores[], const string names[]);
break;
}
cout << "Do you wish to continue? (Y/N):";
cin >> choice;
} while (choice = "Y" || "y");
system("pause");
return 0;
}


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 0回复贴,共1页
<<返回visual吧
分享到:
©2025 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示