Untitled

mail@pastecode.io avatar
unknown
plain_text
8 months ago
985 B
0
Indexable
Never
#pragma once
#include <iostream>
#include <vector>
#include <fstream>
std::ifstream in("input.txt");
std::ofstream out("output.txt");
class школнык {
	std::vector <int> marks;
	std::string name;
public:
	void printMarks() {
		for (int i : marks) {
			out << i << ' ';
		}
	}
	void setName(std::string name1) {
		name = name1;
	}
	void addMark(int m) {
		marks.push_back(m);
	}
	std::string getName() {
		return name;
	}
};
class БухУчет {
	std::vector <школнык> ju;
public:
	void addStudent(школнык& b) {
		ju.push_back(b);
	}
	void addMark(int index, int mark) {
		ju[index - 1].addMark(mark);
	}
	void printLog() {
		out << "---jurnal---\n";
		for (auto i : ju) {
			out << i.getName() << ' ';
			i.printMarks();
			out << '\n';
		}
	}
	void printStudentLog(int index) {
		out << "---Ocenki " << ju[index - 1].getName() << "---\n";
		out << ju[index - 1].getName() << ' ';
		ju[index - 1].printMarks();
	}
};