题目:有三名同学,在一次考试中三科成绩分别如下表,请输出三名同学的平均成绩:
|----|-----|-----|-----|
|    | 语文  | 数学  | 英语  |
| 张三 | 100 | 100 | 100 |
| 李四 | 90  | 50  | 100 |
| 王五 | 60  | 70  | 80  |
            
            
              cpp
              
              
            
          
          #include <iostream>
#include <string>
/*考试成绩统计*/
using namespace std;
class Score {
	private :
		string id;
		int chinese;
		int english;
		int math;
	public :
		Score(string name, int score1, int score2, int score3) : id(name), chinese(score1), english(score2), math(score3) {}
		
		double getAvgScore(){
			return (chinese + math + english) / 3.0;
		}
		
		string getName() {
			return id;
		}
}; 
int main() {
	Score s1("张三", 100, 100, 100);
	Score s2("李四", 90, 50, 100);
	Score s3("王五", 60, 70, 80);
	
	cout << s1.getName() << "的平均成绩是" << s1.getAvgScore() << endl;
	cout << s2.getName() << "的平均成绩是" << s2.getAvgScore() << endl;
	cout << s3.getName() << "的平均成绩是" << s3.getAvgScore() << endl;
	
	return 0;
}