读取字符串字符时出错

创建的数组数据正常,但我给对象实例化的时候,数据传入就会出现读取字符串时出错,请问是什么原因?
代码功能:输入三组学生的姓名和成绩,进行求综合成绩,然后排序,再输出成绩
代码如下:

#include
#include<string>
using namespace std;
class Student
{
private:
    string studentName;
    float englishGrade;
    float mathGrade;
    float politicGrade;
    float majorGrade;
public:
    void setStudentAllInformation(string studentName, float englishGrade, float mathGrade, float politicGrade, float majorGrade)
    {
        this->studentName = studentName;
        this->englishGrade = englishGrade;
        this->mathGrade = mathGrade;
        this->politicGrade = politicGrade;
        this->majorGrade = majorGrade;
    }
    string getStudentName()
    {
        return studentName;
    }
    void getScore()
    {
        cout << "英语:" << this->englishGrade;
        cout << "数学:" << this->mathGrade;
        cout << "政治:" << this->politicGrade;
        cout << "专业课:" << this->majorGrade;

    }
    double getTotalGrade()
    {
        return (this->englishGrade * 0.15 + this->mathGrade * 0.2 + this->politicGrade * 0.2 + this->majorGrade * 0.45);
        /*cout<<"英语成绩为:";cin>>englishGrade;
        cout<<"数学成绩为:";cin>>mathGrade;
        cout<<"政治成绩为:";cin>>politicGrade;
        cout<<"专业课成绩为:";cin>>majorGrade;*/
    }
};
class SortSystem
{
private:
    Student _s[3];
public:

    SortSystem(Student* _s)
    {
        _s[3] = *_s;
    }
    void Sort()
    {
        for (int i = 0; i < 2; i++)
        {
            for (int j = 0; j < 2 - i; i++)
            {
                if (_s[j].getTotalGrade() < _s[j + 1].getTotalGrade())
                {
                    Student a;
                    a = _s[j];
                    _s[j] = _s[j + 1];
                    _s[j + 1] = a;
                }
            }

        }
    }
    void ShowAllStudentsScores()
    {
        for (int i = 0; i < 3; i++)
        {
            cout << _s[i].getStudentName() << "的各科成绩为:" << endl;
            _s[i].getScore();
            cout << "综合成绩:" << _s[i].getTotalGrade() << endl;
        }
    }
};
int main(void)
{
    string _studentName;
    float _englishGrade, _mathGrade, _politicGrade, _majorGrade;
    Student students[3];
    for (int i = 0; i < 3; i++)
    {
        cin >> _studentName >> _englishGrade >> _mathGrade >> _politicGrade >> _majorGrade;
        students[i].setStudentAllInformation(_studentName, _englishGrade, _mathGrade, _politicGrade, _majorGrade);
    }
    SortSystem RJ2202(students);
    RJ2202.ShowAllStudentsScores();
    RJ2202.Sort();

    return 0;
}

img

img

排序对象,数组初始化有问题
修改如下:

#include<iostream>
#include<string>
using namespace std;
class Student
{
private:
    string studentName;
    float englishGrade;
    float mathGrade;
    float politicGrade;
    float majorGrade;
public:
    void setStudentAllInformation(string studentName, float englishGrade, float mathGrade, float politicGrade, float majorGrade)
    {
        this->studentName = studentName;
        this->englishGrade = englishGrade;
        this->mathGrade = mathGrade;
        this->politicGrade = politicGrade;
        this->majorGrade = majorGrade;
    }
    string getStudentName()
    {
        return studentName;
    }
    void getScore()
    {
        cout << "英语:" << this->englishGrade;
        cout << "数学:" << this->mathGrade;
        cout << "政治:" << this->politicGrade;
        cout << "专业课:" << this->majorGrade;
 
    }
    double getTotalGrade()
    {
        return (this->englishGrade * 0.15 + this->mathGrade * 0.2 + this->politicGrade * 0.2 + this->majorGrade * 0.45);
        /*cout<<"英语成绩为:";cin>>englishGrade;
        cout<<"数学成绩为:";cin>>mathGrade;
        cout<<"政治成绩为:";cin>>politicGrade;
        cout<<"专业课成绩为:";cin>>majorGrade;*/
    }
};
class SortSystem
{
private:
    Student *_s; // 修改
public:
 
    SortSystem(Student* _s)
    {
        this->_s = _s; // 修改
    }
    void Sort()
    {
        for (int i = 0; i < 2; i++)
        {
            for (int j = 0; j < 2 - i; i++)
            {
                if (_s[j].getTotalGrade() < _s[j + 1].getTotalGrade())
                {
                    Student a;
                    a = _s[j];
                    _s[j] = _s[j + 1];
                    _s[j + 1] = a;
                }
            }
 
        }
    }
    void ShowAllStudentsScores()
    {
        for (int i = 0; i < 3; i++)
        {
            cout << _s[i].getStudentName() << "的各科成绩为:" << endl;
            _s[i].getScore();
            cout << "综合成绩:" << _s[i].getTotalGrade() << endl;
        }
    }
};
int main(void)
{
    string _studentName;
    float _englishGrade, _mathGrade, _politicGrade, _majorGrade;
    Student students[3];
    for (int i = 0; i < 3; i++)
    {
        cin >> _studentName >> _englishGrade >> _mathGrade >> _politicGrade >> _majorGrade;
        students[i].setStudentAllInformation(_studentName, _englishGrade, _mathGrade, _politicGrade, _majorGrade);
    }
    SortSystem RJ2202(students);
    RJ2202.ShowAllStudentsScores();
    RJ2202.Sort();
 
    return 0;
}