练习实验室 #4
Coddy C++ 文件处理 课程的第 18 课,共 23 课。
挑战
简单你会从文件 input.txt 中收到 5 行输入,每行包含一个学生的姓名(字符串)和分数(int)。如果学生的分数低于 50,他们就没有通过课程,请抛出异常消息 Student failed the course。最后,在新的一行输出通过课程的学生的平均分数。
输入
John 60
Mark 85
Stephen 48
Anna 83
Mathew 76
输出
Student failed the course
76
亲手试试
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
// 在这里输入你的代码
return 0;
}C++ 文件处理中的所有课
自己练习: C++ 在线编译器