#include <iostream>
using namespace std;
float _sum = 0;
struct Server {
string OS;
string DBMS;
int InternalMemory;
int Ram;
int value;
Server(string OS, string DBMS, int InternalMemory, int Ram, int value){
this->OS = OS;
this->DBMS = DBMS;
this->InternalMemory = InternalMemory;
this->Ram = Ram;
this->value = value;
}
void AverageSum() {
_sum += value;
};
signed main() {
setlocale(LC_ALL, "Rus");
Server n1("OS/2", "DB2", 130, 22, 3343);
Server n2("Windows / NT", "SQLServer", 230, 24, 2685);
Server n3("SCO / Unix", "Oracle", 110, 48, 3745);
n1.AverageSum();
n2.AverageSum();
n3.AverageSum();
cout << "Среднее значение:" << _sum / 3 << endl;
return 0;
#include <iostream>
using namespace std;
float _sum = 0;
struct Server {
string OS;
string DBMS;
int InternalMemory;
int Ram;
int value;
Server(string OS, string DBMS, int InternalMemory, int Ram, int value){
this->OS = OS;
this->DBMS = DBMS;
this->InternalMemory = InternalMemory;
this->Ram = Ram;
this->value = value;
}
void AverageSum() {
_sum += value;
}
};
signed main() {
setlocale(LC_ALL, "Rus");
Server n1("OS/2", "DB2", 130, 22, 3343);
Server n2("Windows / NT", "SQLServer", 230, 24, 2685);
Server n3("SCO / Unix", "Oracle", 110, 48, 3745);
n1.AverageSum();
n2.AverageSum();
n3.AverageSum();
cout << "Среднее значение:" << _sum / 3 << endl;
return 0;
}