对学习HTML语法和文档结构的心得和以后要避免的错误
时间: 2024-02-17 12:02:26 浏览: 17
(course == NULL) {
cout << "请先录入课程信息" << endl;
teacher_menu();
return;
学习HTML语法和文档结构的关键是掌握HTML标签的用法和语义化。在编 }
ofstream fout("data.txt");
fout << course->id << " " << course->name << endl;
for (写HTML代码时,应该遵循一定的规范,包括正确使用标签,避免嵌套错误,使用vector<Student>::iterator it = course->students.begin(); it != course->students.end(); it++) {
fout << it->id <<合适的属性等。
在学习HTML时,需要注意以下几点:
1. 学习HTML标签的语义化 " " << it->name << " " << it->score1 << " " << it->score2 << " " << it->total,理解每个标签的作用和使用场景,避免滥用无意义的标签。
2. 学_score << endl;
}
fout.close();
cout << "数据已保存" << endl;
teacher_menu();
}
习HTML标签的嵌套规则,避免嵌套错误,导致文档解析出错。
3. 学习 // 读取数据
void load_data() {
ifstream fin("data.txt");
if (!fin.is_open()) {
HTML标签的属性用法,避免滥用属性,使用不必要的属性会增加文档的复杂度 cout << "无保存的数据" << endl;
return;
}
string id, name;
fin >> id >> name;
course = new Course(id, name);
while (!fin.eof()) {
string student_id, student_name;
int score。
4. 学习HTML文档的结构,理解文档的头部和主体部分的作用和实1, score2, total_score;
fin >> student_id >> student_name >> score1 >> score2 >> total_score;
if现方式。
以后要避免的错误包括:
1. 避免滥用无意义的标签,如使用div (!student_id.empty() && !student_name.empty()) {
Student student(student_id, student_name);
student.score1 = score1标签代替具有语义化的标签。
2. 避免嵌套错误,如将块级元素嵌套;
student.score2 = score2;
student.total_score = total_score;
course->add_student(student);
}
}
fin.close();
cout << "数据已加载" << endl;
}
private:
Course* course; // 课程
在行内元素中,或将表格元素嵌套在列表元素中。
3. 避免滥用属性,};
int main() {
ScoreSystem system;
system.load_data();
system.select_identity();
return 0;
}
```
如使用不必要的属性或将属性写在不适当的标签中。
4. 避免忽略HTML文档这个程序实现了一个简单的单门课程成绩管理系统,包括教师和学生两个身的结构,如未正确编写文档头部信息或忽略主体部分的分块结构。