/**************************************************************************
PURPOSE:
BEGIN-TIME: 08/10/25 06:32
FINISH-TIME: 08/10/25 06:55
AUTHOR: ch8_daniel
INPUT: r ------ resistor
OUTPUT: total ------ the total resistor
VERSION: 1.0
**************************************************************************/
#include <iostream>
using namespace std;
int main()
{
float r = 0;
float total = 0;
cout << "Type '0' to quit inputting./n";
while (1)
{
cout << "Enter r: ";
cin >> r;
if (r == 0)
{
break ;
}
total += 1 / r;
}
total = 1 / total;
cout << "Total is : " << total << endl;
return 0;
}
PURPOSE:
BEGIN-TIME: 08/10/25 06:32
FINISH-TIME: 08/10/25 06:55
AUTHOR: ch8_daniel
INPUT: r ------ resistor
OUTPUT: total ------ the total resistor
VERSION: 1.0
**************************************************************************/
#include <iostream>
using namespace std;
int main()
{
float r = 0;
float total = 0;
cout << "Type '0' to quit inputting./n";
while (1)
{
cout << "Enter r: ";
cin >> r;
if (r == 0)
{
break ;
}
total += 1 / r;
}
total = 1 / total;
cout << "Total is : " << total << endl;
return 0;
}