include conio include windows include iostream struct Kvartira int Num

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <conio.h>
#include <windows.h>
#include <iostream.h>
struct Kvartira
{
int Num;
int Men;
float Energy;
};
const int N = 50;
int Mass[N];
void vvod()
{
for (int i = 0; i < N; i++)
{
Mass[i].Num = i + 1;
cin>> Mass[i].Men;
cin>> Mass[i].Energy
}
}
int Plata(int ind)
{
if (Mass[ind].Energy / Mass[ind].Men < 100)
{
return Mass[ind].Energy * 90;
} else return Mass[ind].Energy * 108;
}
void main()
{
float Sum = 0;
vvod();
for (int i = 0; i < N; i++)
{
Sum += Plata(i);
cout << Sum / 100 << " rub" << endl;
}
}