#include <iostream.h>

void main()
{

	int NumOfCircuit =1; //The number of circuit we suppose 3
	double R=0; //The resistance we will enter
	double Rtot[3]={0,0,0}; //The som of resistance for each circuit
	while(NumOfCircuit<4)
	while(1)
	{
		cout << "Give the resistances of Circuit number "<<NumOfCircuit<<" and 0 at the end \n";
		cin >> R;
		if(!R)
		{
			NumOfCircuit++;
			break;
		}
		Rtot[NumOfCircuit-1]+=R;
	}
	
	double R2pR3=Rtot[1]*Rtot[2]/(Rtot[1]+Rtot[2]);//The resistance of R2 and R3 wich are parallel
	double Rfinal=Rtot[0]+R2pR3; // The final Resistance
	cout <<"\n The Resistance is : "<<Rfinal<<"\n";
}