logo
ООП для Заоч / Пинчук Лозовская Программир на С

Void main()

{ int i,N;

float r[100], R, S=0;

cout << "Number of the Resistors N = "; cin >> N;

for (i=0;i<N;i++)

{ cout << "r[" << i << "] = "; cin >> r[i]; }

for (i=0;i<N;i++) S=S+1/r[i];

R=1/S;

cout << "Common resistance R = " << R << "\n";

cout << "Relative part of the thermal power, % \n";

for (i=0;i<N;i++)

cout << "p[" << i << "] = " << R/r[i]*100 << "\n";

}