已发送,如果没有问题的话,麻烦您确认一下,给个五星好评哈!谢谢!

上传是这样的,或者你发个邮箱地址给我吧,我发你

这个平台能识别到引入一些库文件,所以上传不了

请将所有双引号改成英文符号,我这边把代码复制到这个平台时自动把双引号改成中文形式了。

你的“”是英文符号吗?我这边都没问题,用的是C++14,都没有上面的问题

您好,以下为更新后的代码及运行结果,如果没有问题的话,麻烦您确认一下,给个五星好评哈!谢谢!

#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;
struct student{
string stuId;
string name;
double mathScore;
double chineseScore;
double englishScore;
student():stuId(“”),name(“”),mathScore(0.0),chineseScore(0.0),englishScore(0.0){};
};

struct node{
student *stu;
node *next;
};

typedef pair<string, float> PAIR;
bool cmp_by_value(const PAIR& lhs, const PAIR& rhs) {
return lhs.second > rhs.second;
}

int main() {
// task1
cout << “Enter the length of the linked list(number of student objects: ” << endl;
int n;
cin >> n;

// task2
node *start = (node *) malloc(sizeof(node));
node *p = start;

for (int i = 0; i < n; i++) {
node *a = (node *) malloc(sizeof(node));
student * cur_stu = new student();
cout << “Enter StudentId of student” << (i + 1) << endl;
cin >> cur_stu->stuId;
cout << “Enter name of student” << (i + 1) << endl;
cin >> cur_stu->name;
cout << “Enter mathScore of student” << (i + 1) << endl;
scanf(“%lf”,&cur_stu->mathScore);
cout << “Enter chineseScore of student” << (i + 1) << endl;
scanf(“%lf”,&cur_stu->chineseScore);
cout << “Enter englishScore of student” << (i + 1) << endl;
scanf(“%lf”,&cur_stu->englishScore);
a->stu = cur_stu;
a->next = NULL;

p->next = a;
p = p->next;
}

cout << “All students’ information:” << endl;
int i = 1;
p = start;
while ((p = p->next) != NULL) {
cout << “Student” << (i++) << “- stuId: ” << p->stu->stuId << “, name: ” << p->stu->name << “, mathScore: “
<< p->stu->mathScore << “, chineseScore: ” << p->stu->chineseScore << “, englishScore: ” <<
p->stu->englishScore << endl;
}

// task3
cout<<“student ID and average mark of three courses”<<endl;
map<string, int> id_score_map;
p = start;
while ((p = p->next) != NULL){
id_score_map[p->stu->stuId] = 1.0*(p->stu->mathScore+p->stu->chineseScore+p->stu->englishScore)/3.0;
}
vector<PAIR> id_score_vec(id_score_map.begin(), id_score_map.end());
sort(id_score_vec.begin(), id_score_vec.end(), cmp_by_value);
for (int i = 0; i != id_score_vec.size(); ++i) {
cout<<id_score_vec[i].first<<” “<<id_score_vec[i].second<<endl;
}

// task4
cout<<“Student ID whose average mark is smaller than the average mark”<<endl;
float scores = 0.0;
for (int i = 0; i != id_score_vec.size(); ++i) {
scores += id_score_vec[i].second;
}
float average_score = 1.0*scores/n;
for (int i = 0; i != id_score_vec.size(); ++i) {
if (id_score_vec[i].second < average_score){
cout<<id_score_vec[i].first<<” “;
}
}
return 0;
}

\"\"

Reminder
OK
作业代写,代写作业,作业辅导,辅导作业,作业问答,美国作业代写,留学生作业,留学生作业代写,数学作业,数学作业代写,统计作业代写,物理作业代写,金融作业代写,大学作业辅导 Keywords: 作业代写 代写作业 作业辅导 辅导作业 作业问答 美国作业代写 留学生作业 留学生作业代写 数学作业 数学作业代写 统计作业代写 物理作业代写 金融作业代写 大学作业辅导