类和对象
#include
#include
using namespace std;
class Student {
private:
int id;
string name;
int english;
int program;
int math;
public:
void setInformation(int id, const string& name, int english, int program, int math) {
this->id = id;
this->name = name;
this->english = english;
this->program = program;
this->math = math;
}
void showInformation() const {
cout << "ID: " << id << ", Name: " << name << ", English: " << english << ", Programming: " << program << ", Math: " << math << endl;
}
};
int main() {
Student c;
int id, english, program, math;
string name;
cin >> id >> name >> english >> program >> math;
c.setInformation(id, name, english, program, math);
c.showInformation();
return 0;
}