Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
658 B
0
Indexable
Never
#include <string>
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class schilsa {
	string name;
	vector<int> marks = { 2, 2 , 4};
	int nomer_klasa = 6;
public:
	void ad_Marks(int g) {
		marks.push_back(g);
	}
	void MAAAARRKS() {
		for (int i = 0; i < marks.size(); i++)
		{
			cout << marks[i] << " ";
		}
	}
	int sredni_bal() {
		double s = 0.0;
		int j = 0;
		for (int i = 1; i < marks.size(); i++)
		{
			s += marks[i];
		}
		j = marks.size();
		return s / j;
	}
};
int main()
{
	schilsa lax;
	lax.ad_Marks(5);
	lax.MAAAARRKS();
	cout << endl << lax.sredni_bal();
}